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

Support XPU DDP training and autocast for LowBitMatmul #9167

Merged
merged 3 commits into from
Oct 17, 2023

Conversation

yangw1234
Copy link
Contributor

Description

  1. Support XPU DDP training by patching transformers
  2. Add autocast support for LowBitMatmul to speedup mixed precision training

1. Why the change?

Faster end to end training time using multiple intel GPUs

2. User API changes

None

3. Summary of the change

4. How to test?

Manually tested using 4 PVC 1100 on alpaca dataset

if isinstance(value, torch.Tensor):
is_eligible = (
value.is_floating_point()
and value.is_cuda
Copy link
Contributor

Choose a reason for hiding this comment

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

why is_cuda?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

@jason-dai jason-dai left a comment

Choose a reason for hiding this comment

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

LGTM

@yangw1234 yangw1234 merged commit 3fd05fe into intel-analytics:main Oct 17, 2023
16 checks passed
@@ -378,8 +385,7 @@ def forward(self, x: torch.Tensor):
result = result.view(new_shape)
if self.bias is not None:
result += self.bias

return result.to(x.dtype)
return result
Copy link
Contributor

Choose a reason for hiding this comment

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

This line of change causes this issue: https://github.com/analytics-zoo/nano/issues/639
@yangw1234 Please take a look.

liu-shaojun pushed a commit that referenced this pull request Mar 25, 2024
* support autocast in low bit matmul

* Support XPU DDP training

* fix  amp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants