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

Custom recipes use slash path #1760

Merged
merged 1 commit into from
Oct 8, 2024
Merged

Custom recipes use slash path #1760

merged 1 commit into from
Oct 8, 2024

Conversation

RdoubleA
Copy link
Contributor

@RdoubleA RdoubleA commented Oct 7, 2024

Context

What is the purpose of this PR? Is it to

  • add a new feature
  • fix a bug
  • update tests and/or documentation
  • other (please add here)

Custom imports/recipes were fixed by running as modules, but this required users to specify custom recipes as dotpaths, i.e., tune run path.to.my.recipe which isn't consistent (as discussed in #1759). We do the conversion under the hood for them here so they can still specify standard file paths with slashes.

Test plan

both of these now run, and they rely on custom dataset builders located outside of torchtune repo:
tune run --nproc_per_node 8 recipe/sft --config config/sft_llama3_2_1B.yaml
tune run --nproc_per_node 8 recipe/sft.py --config config/sft_llama3_2_1B.yaml

Copy link

pytorch-bot bot commented Oct 7, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/1760

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit a059a29 with merge base a8a64ec (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 7, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.33%. Comparing base (7cf656b) to head (a059a29).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1760      +/-   ##
==========================================
- Coverage   69.33%   67.33%   -2.00%     
==========================================
  Files         305      305              
  Lines       15892    15964      +72     
==========================================
- Hits        11018    10750     -268     
- Misses       4874     5214     +340     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@acisseJZhong acisseJZhong left a comment

Choose a reason for hiding this comment

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

thanks Rafi for the fix. Does this also work with customized configs inside torchtune repo?

@RdoubleA
Copy link
Contributor Author

RdoubleA commented Oct 7, 2024

Does this also work with customized configs inside torchtune repo?

can't run any custom recipes from instead the recipes directory because of ModuleNotFoundError: The torchtune recipes directory isn't a package and you should not import anything from here., but I personally think this is ok

@RdoubleA RdoubleA merged commit 7808f37 into pytorch:main Oct 8, 2024
17 checks passed
@RdoubleA RdoubleA deleted the slash_path branch October 8, 2024 01:01
@joecummings
Copy link
Contributor

Does this also work with customized configs inside torchtune repo?

can't run any custom recipes from instead the recipes directory because of ModuleNotFoundError: The torchtune recipes directory isn't a package and you should not import anything from here., but I personally think this is ok

Wait, so will it still work if the user adds their recipe to the registry?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants