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

Enhance PyTorchRecorder to pass top-level key to extract state_dict #1300

Merged
merged 16 commits into from
Feb 29, 2024

Conversation

antimora
Copy link
Collaborator

This is needed for Whisper weight pt files.

Pull Request Template

Checklist

  • Confirmed that run-checks all script has been executed.
  • Made sure the book is up to date with changes in this PR.

Related Issues/PRs

  1. Enhanced pickle support for state_dict retrieval from nested dictionaries in .pth files huggingface/candle#1671
  2. Chore: Use Candle's published crate version instead of git source code #1299

Changes

  1. Enhanced PyTorchRecorder to accept top level key to tract state_dict
  2. Updated the book
  3. Added new test
  4. Using Candle core head version at a specific revision. Filed Chore: Use Candle's published crate version instead of git source code #1299 to revert once we are about to release.

Testing

Added a new unit test.

Copy link

codecov bot commented Feb 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.56%. Comparing base (4efc683) to head (9fb220b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1300      +/-   ##
==========================================
+ Coverage   85.44%   85.56%   +0.11%     
==========================================
  Files         593      594       +1     
  Lines       67966    67997      +31     
==========================================
+ Hits        58076    58180     +104     
+ Misses       9890     9817      -73     

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

Copy link
Member

@laggui laggui left a comment

Choose a reason for hiding this comment

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

Thank you for the fix! I'm sure this will be really helpful 🙂

Overall LGTM! Just some minor typos and an open discussion regarding the name of the new method 👍

burn-book/src/import/pytorch-model.md Outdated Show resolved Hide resolved
burn-import/src/pytorch/recorder.rs Outdated Show resolved Hide resolved
burn-import/src/pytorch/recorder.rs Outdated Show resolved Hide resolved
burn-import/src/pytorch/recorder.rs Outdated Show resolved Hide resolved
burn-import/src/pytorch/recorder.rs Outdated Show resolved Hide resolved
Copy link
Member

@nathanielsimard nathanielsimard left a comment

Choose a reason for hiding this comment

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

Agree with @laggui comments, otherwise LGTM.

@antimora antimora changed the title Enhance PyTorchRecorder to pass top level key to extract state_dict Enhance PyTorchRecorder to pass top-level key to extract state_dict Feb 13, 2024
burn-import/src/pytorch/recorder.rs Outdated Show resolved Hide resolved
@antimora antimora added enhancement Enhance existing features blocked Should not be tackled right now labels Feb 14, 2024
@antimora
Copy link
Collaborator Author

We are waiting till a new Candle release. The PR implementation uses Git's version from Candle's main.

@laggui laggui mentioned this pull request Feb 29, 2024
2 tasks
@antimora antimora removed the blocked Should not be tackled right now label Feb 29, 2024
@antimora antimora merged commit 688958e into tracel-ai:main Feb 29, 2024
14 checks passed
@antimora antimora deleted the top-level-key branch February 29, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhance existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants