Improve the compilation speed when compiling for multiple architectures.#12490
Merged
Improve the compilation speed when compiling for multiple architectures.#12490
Conversation
Contributor
|
So this change is only for training? |
Contributor
Author
yes, and it only affect the torch extension build which is part of ORTModule training. The flag for our CUDA EP code has already added in this PR #8974. |
baijumeswani
previously approved these changes
Aug 9, 2022
orttraining/orttraining/python/training/ortmodule/torch_cpp_extensions/install.py
Outdated
Show resolved
Hide resolved
baijumeswani
approved these changes
Aug 9, 2022
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description: Improve compiling speed for multiple architectures.
Since cuda 11.2, NVCC introduce a build option '--threads':
4.2.5.4. --threads number (-t)
Specify the maximum number of threads to be used to execute the compilation steps in parallel.
This option can be used to improve the compilation speed when compiling for multiple architectures. The compiler creates number threads to execute the compilation steps in parallel. If number is 1, this option is ignored. If number is 0, the number of threads used is the number of CPUs on the machine.
Previously, CUDA extensions built in 65.59178829193115 seconds, after enabling it, CUDA extensions built in 48.63271450996399 seconds.
Motivation and Context