Skip to content

Commit

Permalink
Require setuptools>=70 and update deprecated api
Browse files Browse the repository at this point in the history
Signed-off-by: Dong Hyuk Chang <donghyukc@nvidia.com>
  • Loading branch information
Dong Hyuk Chang committed Sep 27, 2024
1 parent fdaf607 commit 78b6b1b
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from megatron.core.dist_checkpointing.mapping import ShardedStateDict
from megatron.core.parallel_state import get_tensor_model_parallel_group
from megatron.core.transformer import TransformerConfig
from pkg_resources import packaging
import packaging
from torch import Tensor
from torch.nn.modules.loss import _Loss

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import torch.nn.functional as F
from einops import rearrange, reduce, repeat
from omegaconf import DictConfig, ListConfig, OmegaConf
from pkg_resources import packaging
import packaging
from pytorch_lightning.trainer.trainer import Trainer
from transformers import CLIPVisionModel, SiglipVisionModel

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from typing import Any, Callable, Optional

import torch
from pkg_resources import packaging
import packaging

from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults
from nemo.collections.nlp.parts import utils_funcs
Expand Down
3 changes: 1 addition & 2 deletions nemo/collections/nlp/modules/common/megatron/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@

try:
# Flash Attention Triton
import pkg_resources
from flash_attn.flash_attn_triton import flash_attn_func as flash_attn_func_triton

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

flash_attn_func_triton = None

Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ onnx>=1.7.0
python-dateutil
ruamel.yaml
scikit-learn
setuptools>=65.5.1
setuptools>=70.0.0
tensorboard
text-unidecode
torch
Expand Down
1 change: 0 additions & 1 deletion tests/collections/nlp/test_flash_attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
HAVE_FA = False

try:
import pkg_resources
import triton

HAVE_TRITON = True
Expand Down

0 comments on commit 78b6b1b

Please sign in to comment.