Skip to content

Commit

Permalink
Fix triton import guards (NVIDIA#8552)
Browse files Browse the repository at this point in the history
* Fix triton import guards

Signed-off-by: Michal Futrega <[email protected]>

* Update attention.py

Signed-off-by: Michal Futrega <[email protected]>

---------

Signed-off-by: Michal Futrega <[email protected]>
Signed-off-by: duongvdo <[email protected]>
  • Loading branch information
michal2409 authored and va290 committed Mar 10, 2024
1 parent 14ee191 commit e78c1a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nemo/collections/nlp/modules/common/megatron/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
# pinned triton version for flash-attention triton https://github.com/HazyResearch/flash-attention/blob/main/flash_attn/flash_attn_triton.py#L3
assert pkg_resources.get_distribution("triton").version == '2.0.0.dev20221202'

except (ImportError, ModuleNotFoundError, AssertionError):
except (ImportError, ModuleNotFoundError, AssertionError, pkg_resources.DistributionNotFound):

flash_attn_func_triton = None

Expand Down

0 comments on commit e78c1a3

Please sign in to comment.