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

TE FP8 integration #1096

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SanjuCSudhakaran
Copy link
Contributor

@SanjuCSudhakaran SanjuCSudhakaran commented Jun 25, 2024

What does this PR do?

Refactoring transformer_engine FP8 support in optimum-habana. This removes model specific changes and makes the code more model agnostic.

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@SanjuCSudhakaran SanjuCSudhakaran marked this pull request as ready for review June 26, 2024 07:28
@vivekgoe vivekgoe requested a review from libinta June 26, 2024 08:02
@@ -574,6 +574,46 @@ python3 ../gaudi_spawn.py --use_deepspeed --world_size 8 run_lora_clm.py \
--flash_attention_causal_mask True
```

- Multi-card finetuning of Llama2-70B with DeepSpeed ZeRO-3 optimization, LoRA and FP8 precision:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can just modify existing command for FP8 precision (instead of adding a new one).

@@ -291,14 +291,6 @@ class GaudiTrainingArguments(TrainingArguments):
metadata={"help": "Whether to use fp8 for training."},
)

fp8_recipe_format: Optional[str] = field(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@libinta please note we deleted this because we do not want to expose low level numeric selection to user as of now. In future we can revisit this.

@vivekgoe
Copy link
Collaborator

vivekgoe commented Jun 26, 2024

@regisss @libinta please help review this PR. This is a cleaned up version of TE integration (tested with Llama-7B, Llama-70B, Mixtral-7B fine-tuning tasks). Changes were done mainly for following reasons,

  • Align to newer PEFT version (0.10.0) which helps reducing custom changes to support LoRA layers in fp8,
  • Add TE support for models using activation_checkpointing (in a generic way),
  • Align TE code to accelerator repo to extent possible. Limit fp8 configuration interface exposed to user (allow only well tested configuration for now)

FYI @SanjuCSudhakaran will create another PR adding Llama-7B test for this feature. It is tested with 1.16.0 release and can be merged without waiting for 1.17.0

@vivekgoe vivekgoe added the run-test Run CI for PRs from external contributors label Jun 26, 2024
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@vivekgoe
Copy link
Collaborator

Related PR with tests #1106

@vivekgoe vivekgoe added the synapse1.17 PR that should be available along with Synapse 1.17 but have no dependency on Synapse 1.17 content. label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-test Run CI for PRs from external contributors synapse1.17 PR that should be available along with Synapse 1.17 but have no dependency on Synapse 1.17 content.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants