Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gridsearch nkg #127

Merged
merged 42 commits into from
Jan 27, 2024
Merged

Gridsearch nkg #127

merged 42 commits into from
Jan 27, 2024

Conversation

caiw
Copy link
Member

@caiw caiw commented Jan 15, 2024

Changes

Note

@caiw caiw added not-yet-ready-for-merging gridsearch Related to the gridsearch labels Jan 15, 2024
@caiw caiw self-assigned this Jan 15, 2024
Copy link
Member

@neukym neukym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A handful of comments, but otherwise, looks great 👍

invokers/run_gridsearch.py Outdated Show resolved Hide resolved
invokers/run_gridsearch.py Outdated Show resolved Hide resolved
kymata/gridsearch/plain.py Show resolved Hide resolved
@caiw caiw requested a review from neukym January 15, 2024 15:16
@caiw
Copy link
Member Author

caiw commented Jan 15, 2024

I've moved non-universal default values out of the invoker python script and into the shell script. I think it makes more sense for people to keep personal shell script around for their preferred arguments, rather than hard-code them as defaults in the python gridsearch invoker itself

However this does mean one can't just run python run_gridsearch.py with no arguments any more...

@caiw
Copy link
Member Author

caiw commented Jan 15, 2024

However this does mean one can't just run python run_gridsearch.py with no arguments any more...

I've now created invokers/sh/gridsearch.sh which runs the .py invoker with the arguments. A bit of indirection, but I think it helps keep things clean and flexible.

Sorry for post-request changes @neukym!

@neukym
Copy link
Member

neukym commented Jan 15, 2024

It looks good. I have a couple of minor suggestions but I just need to think about them.

Can you confirm this works with inverse_operator present though? For me it takes longer than 10 mins on lws-gpu, and I have to stop it. Can we print out some sort of basic progress indicator - I thought ollie had got it to 3 mins or so?

@neukym
Copy link
Member

neukym commented Jan 15, 2024

Also can we automatically create /output/ if it doesn't already exist? (sorry)

@caiw
Copy link
Member Author

caiw commented Jan 15, 2024

@neukym

Can you confirm this works with inverse_operator present though?

I'll verify this. (It doesn't error out, but I haven't run it through yet - it's going now.)

@neukym neukym added ready-for-merging and removed ⏸️ blocked/on-hold Blocked or otherwise waiting for something labels Jan 24, 2024
@neukym
Copy link
Member

neukym commented Jan 24, 2024

To confirm, this now works very quickly, even for hexel space (3.30 seconds) 👍 Ready to merge, awaiting @ollieparish's confirmation.

@ollieparish
Copy link
Contributor

Happy with this too, happy to merge but still not convinced about requiring certain parser options to be passed when running, especially as (I'm assuming) this will be run on the login nodes running random functions on sensor space, having a baseline and then only changing 1 or 2 things is quite helpful (for me at least)

@neukym
Copy link
Member

neukym commented Jan 24, 2024

[...] but still not convinced about requiring certain parser options to be passed when running, especially as (I'm assuming) this will be run on the login nodes running random functions on sensor space, having a baseline and then only changing 1 or 2 things is quite helpful

Agreed 👍 let's hold off from merging until @caiw is with us on Friday.

@caiw
Copy link
Member Author

caiw commented Jan 26, 2024

still not convinced about requiring certain parser options to be passed when running, especially as (I'm assuming) this will be run on the login nodes running random functions on sensor space, having a baseline and then only changing 1 or 2 things is quite helpful (for me at least)

Happy to discuss this!

If you're talking about removing arguments' default values, thereby requiring them to be supplied at the cli, my thinking was as follows:

It's better to have the gridsearch functions themselves, and the cli invoker, be agnostic to any one specific analysis project, and more just library code. Certain things can have default values if they make sense as a generic default for all (i.e. "we recommend this" or "you'd need a reason to change this", like --seconds-per-split or --audio-shift-correction), but if it's just a project-by-project save-some-typing thing like --function-name or --inverse-operator-dir, then it makes sense to store the default values in a different project-specific script.

Otherwise we have the situation where:

  1. it's not clear which arguments are true defaults/recommendations (--audio-shift-correction) and which are just conveniences (--data-path, or the [currently unused] participants variable in run_gridsearch.py)
  2. changes to these defaults within one specific project will either end up getting into the codebase, which will can cause downstream conflicts for other users, or else be rendered meaningless as time goes on

When running repeated analyses for a given project project, one can have a separate shell/python script which calls the gridsearch function, providing default params, and allowing rapid re-running only changing one or two things. E.g. I might have a gridsearch_swipe_pitch_dataset_3.py which contains paths and defaults for this project, and just calls the toolbox as a package.

I'm not religious on these points, but that was my thinking.

If I've misunderstood the point: sorry, and happy to discuss what you actually meant :)

@neukym
Copy link
Member

neukym commented Jan 26, 2024

We have agreed to remove requirements (and reinsert defaults) - but that in the long run, everything will be done via config files, but with CLI argument overrides (documented in #137).

submit_gridsearch.sh Outdated Show resolved Hide resolved
@caiw
Copy link
Member Author

caiw commented Jan 26, 2024

When we've tracked down the bug with the mismatched hemisphere sizes, I'm happy for this to be merged in

@@ -18,19 +18,23 @@
args=(5) # 2 3 4 5 6 7 8 9 10)
ARG=${args[$SLURM_ARRAY_TASK_ID - 1]}

# This gets the directory of the toolbox, assuming that *this file you're reading right now* is in the root directory of
# the toolbox
TOOLBOX_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this doesn't work on the queue:

'/usr/bin/bash: line 1: cd: /var/spool/slurm/job3347806: No such file or directory'

Switching back.

@neukym neukym merged commit 1090c14 into main Jan 27, 2024
1 check passed
@neukym neukym deleted the gridsearch-nkg branch January 27, 2024 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gridsearch Related to the gridsearch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gridsearch should output .nkg files, not .stc files
3 participants