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

print selene_sdk version, add config and model file to output, add ra… #191

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ygliu2016
Copy link

…ndom suffix to output directory name

Reference Issues/PRs

What does this implement/fix? Explain your changes.

What testing did you do to verify the changes in this PR?

@aaronkw aaronkw requested a review from kathyxchen December 20, 2022 14:45
@kathyxchen
Copy link
Collaborator

Thanks Aaron for adding me to this PR, and thank you @ygliu2016 for your work on this! I've left some comments--feel free to tag me in a comment once you've updated / tested the changes based on the review, and let me know if you have any questions in the meantime. Overall it looks good! Thanks again :)

@ygliu2016
Copy link
Author

Overall it looks good!

Thanks Aaron for adding me to this PR, and thank you @ygliu2016 for your work on this! I've left some comments--feel free to tag me in a comment once you've updated / tested the changes based on the review, and let me know if you have any questions in the meantime. Overall it looks good! Thanks again :)

H, Kathy, thanks for coming back. Would you please tell me where are your comments? In which repository? Thanks.

@kathyxchen
Copy link
Collaborator

The comments are directly in the changes you made - so if you scroll up above my comment or click 'files changed' tab you should be able to see what I wrote at the corresponding lines of code!

@ygliu2016
Copy link
Author

The comments are directly in the changes you made - so if you scroll up above my comment or click 'files changed' tab you should be able to see what I wrote at the corresponding lines of code!

I am so sorry. But I can not see you comments at repository ygliu2016/selene, branch info.

@kathyxchen
Copy link
Collaborator

Hi @ygliu2016 , were you able to find the comments after you made the test comment? It's at https://github.com/FunctionLab/selene/pull/191/files "Files Changed" tab

@ygliu2016 ygliu2016 closed this Jan 11, 2023
@ygliu2016
Copy link
Author

No, I cannot. Unfortunately, I can only see my test comment. Can you comment directly in the code?
Thanks.

@ygliu2016 ygliu2016 reopened this Jan 11, 2023
Copy link
Collaborator

@kathyxchen kathyxchen left a comment

Choose a reason for hiding this comment

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

Hi @ygliu2016, I've resubmitted the comments, hopefully this time it works!! Thanks for your patience :)

selene_sdk/utils/config_utils.py Outdated Show resolved Hide resolved
operations = configs["ops"]

#print selene_sdk version
if "selene_sdk_version" not in configs:
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe simplify this to version. I think it's also OK to assume that version is never specified in the config and to add it automatically, e.g. moving from selene_sdk import version to the top of the page. I think you can also directly do import selene_sdk and use selene_sdk.__version__ -- not sure which is better practice.

Copy link
Author

Choose a reason for hiding this comment

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

Not sure about name "selene_sdk_version" vs "version". May want to keep the longer version at this time.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK I thought about it more, and I think it's better to have this be automatically populated? Let's just remove lines 322 and 323 outright.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please adjust based on comments above, I think it makes sense to just auto-populate since almost no one will try to specify it manually in their config

selene_sdk/utils/config_utils.py Outdated Show resolved Hide resolved
@@ -343,9 +357,29 @@ def parse_configs_and_run(configs,
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
#torch.backends.cudnn.deterministic = True
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are these commented out?

Copy link
Author

Choose a reason for hiding this comment

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

It is your code, which is not included in the main repository of selene. I am not sure if the code is necessary and thus copied here but commented them. It seems to me that with a seed, there is already deterministic in it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the clarification. Please un-comment this as we need it for ensuring all aspects are deterministic.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same with the commented out line in 365, if that is my code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

can you remove the commented out lines in 364 and 365?

selene_sdk/utils/config_utils.py Outdated Show resolved Hide resolved
selene_sdk/utils/config_utils.py Show resolved Hide resolved
@ygliu2016
Copy link
Author

Thank you very much for the comments and in fact, for your patience as well.

Copy link
Collaborator

@kathyxchen kathyxchen left a comment

Choose a reason for hiding this comment

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

Added last few comments! Let me know when these final changes have been incorporated and tested. :) Thank you

operations = configs["ops"]

#print selene_sdk version
if "selene_sdk_version" not in configs:
Copy link
Collaborator

Choose a reason for hiding this comment

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

OK I thought about it more, and I think it's better to have this be automatically populated? Let's just remove lines 322 and 323 outright.

@@ -343,9 +357,29 @@ def parse_configs_and_run(configs,
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
#torch.backends.cudnn.deterministic = True
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the clarification. Please un-comment this as we need it for ensuring all aspects are deterministic.

@@ -343,9 +357,29 @@ def parse_configs_and_run(configs,
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
#torch.backends.cudnn.deterministic = True
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same with the commented out line in 365, if that is my code.

selene_sdk/utils/config_utils.py Show resolved Hide resolved
@jzthree
Copy link
Contributor

jzthree commented Jan 21, 2023

I think torch.backends.cudnn.deterministic = True is much slower, and that's probably why it was commented out before

@kathyxchen
Copy link
Collaborator

kathyxchen commented Jan 21, 2023 via email

@aaronkw aaronkw requested a review from kathyxchen February 21, 2023 16:49
Copy link
Collaborator

@kathyxchen kathyxchen left a comment

Choose a reason for hiding this comment

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

hi @ygliu2016, I made another pass - some of the conversations you marked resolved I had some minor comments to fully resolve them. Can you tag me when you've finished the changes so I know to review this PR again? thanks!

@@ -47,6 +47,6 @@ train_model: !obj:selene_sdk.TrainModel {
}
random_seed: 1447
output_dir: ./training_outputs
create_subdirectory: False
create_subdirectory: True
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume this was changed because of testing - can this be changed back since it's not relevant to the PR?

# copy model file or directory to output
model_input = configs['model']['path']
if os.path.isdir(model_input): # copy the directory
shutil.copytree (model_input,
Copy link
Collaborator

Choose a reason for hiding this comment

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

spacing here has not been fixed still. Please adjust so it adheres to the current style in the codebase, thank you!

operations = configs["ops"]

#print selene_sdk version
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove commented out print statement

operations = configs["ops"]

#print selene_sdk version
if "selene_sdk_version" not in configs:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please adjust based on comments above, I think it makes sense to just auto-populate since almost no one will try to specify it manually in their config

@@ -343,9 +357,29 @@ def parse_configs_and_run(configs,
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
#torch.backends.cudnn.deterministic = True
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you remove the commented out lines in 364 and 365?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants