-
Notifications
You must be signed in to change notification settings - Fork 107
Export stateful executor states toThunderModule
#2585
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
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
TE_AVAILABLE = False | ||
try: | ||
import transformer_engine as _te_mod # noqa: F401 | ||
import transformer_engine.pytorch as te # type: ignore | ||
from transformer_engine.common import recipe # type: ignore | ||
from thunder.executors.transformer_engineex import transformer_engine_ex, TransformerEngineTransform | ||
|
||
TE_AVAILABLE = True | ||
except Exception: | ||
te = None # type: ignore | ||
recipe = None # type: ignore | ||
TE_AVAILABLE = False |
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.
At glance I'm speculating that pytest.importerskip("transformer_engine")
would be sufficing (ref)
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.
Yes, but I didn't want to skip the entire test file, as future tests might not depend on the te
executor
for more information, see https://pre-commit.ci
… executor removing the post execution transform
for more information, see https://pre-commit.ci
What does this PR do?
Closes #2438.
Summary
transformer_engine_ex
.Usage
The export is controlled by passing the transform to the transforms list:
We might or might not go towards a compiler flag to make this more intuitive for the user (hence handling this transform automatically).
Whole example:
Why it matters