Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/no-torch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
pull_request:
paths:
- '.github/workflows/no-torch.yml'
- 'op_builder/**'
schedule:
- cron: "0 0 * * *"

Expand Down
6 changes: 5 additions & 1 deletion op_builder/mlu/fused_adam.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
# DeepSpeed Team

from .builder import MLUOpBuilder
import torch

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

FYI @Andy666G - this change broke the no-torch workflow. See more info in the PR comment, but please let us know if you have any concerns with this change,


try:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we import torch in multi_tensor_adam if it is the only place where you need torch?
Then you can throw a more specific error when torch is unavailable and multi_tensor_adam is called.

import torch
except ImportError as e:
pass


class MLUFusedAdam:
Expand Down