-
Notifications
You must be signed in to change notification settings - Fork 26.3k
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
Enable torchdynamo with torch_tensorrt(fx path) #17765
Merged
Merged
Changes from 23 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
4a0fe7f
enable fx2trt
3cf0eab
Update perf_train_gpu_one.mdx
fb92f4c
Update perf_train_gpu_one.mdx
e78f9d5
add lib check
4c44bb3
Merge branch 'torchdynamo_fx2trt_2' of https://github.com/frank-wei/t…
1964784
update
ea3e1cd
Merge remote-tracking branch 'origin/main' into torchdynamo_fx2trt_2
stas00 db121a8
format
43f450a
Merge branch 'torchdynamo_fx2trt_2' of https://github.com/frank-wei/t…
976c7db
update
fdd10b0
fix import check
a1b9b9e
fix isort
10fd918
improve doc
6c6835d
refactor ctx manager
0d10b6b
fix isort
f1b6f30
black format
8312edd
isort fix
066e069
fix format
2649683
update args
ec115e2
update black
d0262aa
cleanups
stas00 4256c99
Merge remote-tracking branch 'origin/main' into torchdynamo_fx2trt_2
stas00 e8bf0a5
Update perf_train_gpu_one.mdx
6b1d03b
code refactor
599e7aa
code refactor to init
81e13a5
remove redundancy
2277278
isort
8b65516
replace self.args with args
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big fan of having this as an attribute of the
TrainingArguments
: I think it will break serialization (see here). This all could fit in a function that takes the value ofself.dynamo
(since it's the only field ofTrainingArguments
it uses) and lies inintegrations.py
. The code in the trainer file should then be adapted slightly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sgugger, that sounds good to me. I moved the function to
integrations.py
but has circular import issue.Is it good to leave function
get_torchdynamo_ctx
as a member ofTrainingArguments
? Or leave it inimport_utils.py
to stay together withis_torchdynamo_available()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be imported at all in the
training_args.py
module, only in thetrainer.py
. As I said, you shouldn't add new attributes toTrainingArguments
that are not serializable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sgugger, the original implementation calculated the context on every call - that's why I suggested to move the logic to the argrparse stage, since this logic needs to be done only once per program run.
What would be a good place then to perform this figuring out? In trainer's init probably, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works, yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frank-wei, please let me know if you need help here - moving to trainer's init that is.