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

feat: exit on unknown args #421

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ChanderG
Copy link

Description of the change

Logs and errors out in case of unknown input args.

Related issue number

Closes #420

How to verify the PR

Simply run with some extra/flags with typos etc.

Was the PR tested

Manually.

Signed-off-by: ChanderG <mail@chandergovind.org>
Copy link

Thanks for making a pull request! 😃
One of the maintainers will review and advise on the next steps.

@github-actions github-actions bot added the feat label Dec 16, 2024
) = parser.parse_args_into_dataclasses(return_remaining_strings=True)

peft_method = additional.peft_method
exp_metadata = additional.exp_metadata
if leftover:
logging.error("Extra un-recognized arguments found: %s", leftover)
sys.exit(USER_ERROR_EXIT_CODE)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't be better to log and continue?

Copy link
Author

Choose a reason for hiding this comment

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

Yes - that is also ok. I would prefer immediate exit - since there are usually a wall of log output and this can get missed out - but we can go with whatever is the consensus.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry for the delay in reviewing this, there are two issues here -- to pass in accelerate launch arguments via JSON for kube deployments, the user must pass in a new field called accelerate_launch_args as described here. This is interpreted in the accelerate_launch.py script and then ignored in SFTTrainer. This change would break this behavior. I can see how being warned about misspellings or additional arguments is helpful. We can start this off as warning to not break current behavior or this PR can address the issue with accelerate_launch_args by removing them in the accelerate_launch.py script

) = parser.parse_args_into_dataclasses(return_remaining_strings=True)

peft_method = additional.peft_method
exp_metadata = additional.exp_metadata
if leftover:
logging.error("Extra un-recognized arguments found: %s", leftover)
sys.exit(USER_ERROR_EXIT_CODE)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry for the delay in reviewing this, there are two issues here -- to pass in accelerate launch arguments via JSON for kube deployments, the user must pass in a new field called accelerate_launch_args as described here. This is interpreted in the accelerate_launch.py script and then ignored in SFTTrainer. This change would break this behavior. I can see how being warned about misspellings or additional arguments is helpful. We can start this off as warning to not break current behavior or this PR can address the issue with accelerate_launch_args by removing them in the accelerate_launch.py script

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

Successfully merging this pull request may close these issues.

Log and/or exit on unknown args
3 participants