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

Enable torch.compile for loss_fn #597

Merged
merged 16 commits into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions submission_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ def train_once(
]
eager_backend_workloads = ['librispeech_deepspeech']
aot_eager_backend_workloads = []
loss_compilation_workloads = [
'fastmri', 'librispeech_deepspeech', 'ogbg', 'wmt'
]
base_workload = workloads.get_base_workload_name(workload_name)
if base_workload in compile_error_workloads:
logging.warning(
Expand All @@ -247,6 +250,8 @@ def train_once(
else:
logging.info('Performing `torch.compile`.')
model_params = torch.compile(model_params)
if base_workload in loss_compilation_workloads:
workload.loss_fn = torch.compile(workload.loss_fn)
logging.info('Initializing optimizer.')
with profiler.profile('Initializing optimizer'):
optimizer_state = init_optimizer_state(workload,
Expand Down
Loading