Skip to content

Problem with result caching if evaluation is interrupted #653

Closed

Description

@toncho11

I am running MOABB benchmark or just using the normal evaluation and the process is interrupted:

  • by the user
  • or there is an error (memory allocation in my case)

For example, if the interruption was at 3/64 subject then running again with overwrite=false will not process the other 64-3 subjects but it will simply use the 3 processed subjects in the final result as if the dataset was of 3 subjects (and not 64).
Actually the same happens when you use less subjects manually than the total number of subjects for the dataset.

I think this can lead to false results if you are not aware of this behavior.

Activity

  1. PierreGtch commented on Oct 7, 2024

    @PierreGtch
    Collaborator

    Indeed, we should save the results of the benchmark immediately after computation to avoid this issue. I tried implementing this, but something else was breaking.I could not find what. If you have time, you can take over this PR :) #422

  2. tomMoral commented on Oct 7, 2024

    @tomMoral
    Collaborator

    MAybe a way to fix this with not too much code would be to rely on joblib.Memory? (just an uninformed guess).
    Happy to help if you think it could be valid.

  3. PierreGtch commented on Oct 8, 2024

    @PierreGtch
    Collaborator

    Indeed, replacing the for loops in the evaluations with joblib would be great! We started to discuss it here #481

  4. toncho11 commented on Oct 8, 2024

    @toncho11
    CollaboratorAuthor

    I think it saves the results or it marks the first processed subjects as such, but it does not continue processing the rest of the subjects after the interruption. It decides that the dataset is already entirely processed. Is there some flag for that? There should be a check that counts how many subjects were cached and how many needs to be further processed. There can even be a user message: "3 subjects already cached, proceeding with N-3" where N is the total number of subjects for this dataset.

  5. PierreGtch commented on Oct 9, 2024

    @PierreGtch
    Collaborator

    @toncho11 do you have a minimal example to reproduce this behavior?

  6. toncho11 commented on Oct 9, 2024

    @toncho11
    CollaboratorAuthor

    It is a subtle problem that I am trying to explain here.

    • Run the benchmark for P300 for example
    • You can press "Stop" in for example "Spyder" in the middle of a dataset processing (2-3 subjects already processed for example). Memorize the current dataset at which you have stopped processing.
    • Switch to "overwrite" false.
    • Re-run the benchmark and it will skip the dataset at which you were last entirely. It will take the results only from the subjects processed, not including the unprocessed subjects. And this is the problem. It keeps going to the next dataset even if there are unprocessed subjects left in the dataset.

    Same goes for an error like calculation or memory allocation.
    It is a silent problem where your result becomes false.

    Thank you!

  7. sylvchev commented on Mar 5, 2025

    @sylvchev
    Member

    I could reproduce the error, I'm looking into it

  8. sylvchev commented on Mar 5, 2025

    @sylvchev
    Member

    Should update the _alread_computed here

    def _already_computed(

  9. bruAristimunha commented on Mar 6, 2025

    @bruAristimunha
    Collaborator

    Finally fix @toncho11! you can test with source moabb :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions