-
Notifications
You must be signed in to change notification settings - Fork 363
chore: reenable py313 #3455
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
chore: reenable py313 #3455
Conversation
No ciflow labels are configured for this repo. |
ff1c583
to
ba764bf
Compare
- name: Install Rust | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
source $HOME/.cargo/env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you don't need to install rust. Instead, you should try to bump the version of transformers
in tests/py/requirements.txt
. transformers 4.40.2
depended on tokenizers 0.19.x
, but tokenizers 0.19.x
didn't have wheels for cp313. That's why pip downloaded the source archive of tokenizers
and then compiled unsuccessfully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated transformers
doesn't match the results of BERT, compared with old transformers and TRT, so we fixed the version here. Any idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test_bert_base_uncased
in test_models
and test_models_export
was flawed. The inputs were defined as torch.randint(0, 1, ...)
, which returned a meaningless tensor filled with all zeros because the value of the second arg high
is exclusive. To get a useful tensor the high
arg should be at least 2, like https://pytorch.org/TensorRT/tutorials/_rendered_examples/dynamo/torch_compile_transformers_example.html.
323e177
to
404365a
Compare
8b6f880
to
f60e091
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
transformers==4.40.2 | ||
nvidia-modelopt[deploy,hf,torch]~=0.17.0 | ||
transformers==4.49.0 | ||
nvidia-modelopt[deploy,hf,torch]~=0.17.0; python_version < "3.13" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modelopt doesn't support 3.13 yet ? So, quantization also won't work right in Python 3.13?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, I think we've already directly skip quantization tests like
TensorRT/tests/py/dynamo/models/test_models_export.py
Lines 201 to 220 in d3eb817
@unittest.skipIf( | |
not importlib.util.find_spec("modelopt"), | |
"ModelOpt is required to run this test", | |
) | |
@pytest.mark.unit | |
def test_base_fp8(ir): | |
import modelopt.torch.quantization as mtq | |
from modelopt.torch.quantization.utils import export_torch_mode | |
class SimpleNetwork(torch.nn.Module): | |
def __init__(self): | |
super(SimpleNetwork, self).__init__() | |
self.linear1 = torch.nn.Linear(in_features=10, out_features=5) | |
self.linear2 = torch.nn.Linear(in_features=5, out_features=1) | |
def forward(self, x): | |
x = self.linear1(x) | |
x = torch.nn.ReLU()(x) | |
x = self.linear2(x) | |
return x |
Users may not be aware of it though
@@ -62,6 +64,22 @@ def not_implemented(*args: List[Any], **kwargs: Dict[str, Any]) -> Any: | |||
return wrapper | |||
|
|||
|
|||
def needs_refit(f: Callable[..., Any]) -> Callable[..., Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can make this a bit more generic (like for any feature in the FeatureSet)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think it mostly looks good, I think we should think about making the requires decorator a bit more generic and unify needs_torch_tensorrt_runtime
and needs_refit
, maybe something like needs_feature
. Maybe something for after 2.7
sure, will think about it for the next release. |
Description
Reenabled Python 3.13 builds since TensorRT has 3.13 wheels available now for TensorRT 10.9.
Type of change
Checklist: