Skip to content

Commit

Permalink
Fix MLFlow Save Model for TE (#1353)
Browse files Browse the repository at this point in the history
  • Loading branch information
j316chuck authored Jul 12, 2024
1 parent 6b256cb commit 502eb12
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion llmfoundry/callbacks/hf_checkpointer.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,12 @@ def dtensor_to_tensor_hook(
model_saving_kwargs['transformers_model'] = components
model_saving_kwargs.update(self.mlflow_logging_config)

mlflow_logger.save_model(**model_saving_kwargs)
context_manager = te.onnx_export(
True,
) if is_te_imported and state.precision == Precision.AMP_FP8 else contextlib.nullcontext(
)
with context_manager:
mlflow_logger.save_model(**model_saving_kwargs)

# Upload the license file generated by mlflow during the model saving.
license_filename = _maybe_get_license_filename(
Expand Down

0 comments on commit 502eb12

Please sign in to comment.