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
[ONNX] Add huggingface models into CI tests #107247
Conversation
[ONNX] Add transformers models into no runtime test of fx exporter [ghstack-poisoned]
[ONNX] Add transformers models into no runtime test of fx exporter ghstack-source-id: 01663e84842d7dd46fd7a72154ea1b2d5bb655d7 Pull Request resolved: #107247
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/107247
Note: Links to docs will display an error until the docs builds have been completed. ✅ 1 Unrelated FailureAs of commit 487fa54 with merge base a4eae43 (): UNSTABLE - The following job failed but was likely due to flakiness present on trunk and has been marked as unstable:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
[ONNX] Add transformers models into no runtime test of fx exporter [ghstack-poisoned]
[ONNX] Add transformers models into no runtime test of fx exporter ghstack-source-id: 84f2b39baf9f4a44e2ce4c6c50c4a0364ea7b8eb Pull Request resolved: #107247
[ONNX] Add transformers models into no runtime test of fx exporter [ghstack-poisoned]
[ONNX] Add transformers models into no runtime test of fx exporter ghstack-source-id: 3408fc7f4f1db69f5d6368520749022f9a0ab945 Pull Request resolved: #107247
1. Add a list of HF models to CI tests. The PR intends to build them from Config, but some of them are not supported with Config. NOTE: Loaded from pre-trained model could potentially hit [uint8/bool conflict](huggingface/transformers#21013) when a newer version of transformers is used. - Dolly has torch.fx.Node in OnnxFunction attribute, which is currently not supported. - Falcon and MPT has unsupported user coding to Dynamo. 2. Only update GPT2 exporting with real tensor to Config, as FakeMode rises unequal input errors between PyTorch and ORT. The reason is that [non-persistent buffer is not supported](#107211) [ghstack-poisoned]
[ONNX] Add transformers models into no runtime test of fx exporter ghstack-source-id: 56fdbc3a94c35f13010e1349581c3f3a5d505b91 Pull Request resolved: #107247
1. Add a list of HF models to CI tests. The PR intends to build them from Config, but some of them are not supported with Config. NOTE: Loaded from pre-trained model could potentially hit [uint8/bool conflict](huggingface/transformers#21013) when a newer version of transformers is used. - Dolly has torch.fx.Node in OnnxFunction attribute, which is currently not supported. - Falcon and MPT has unsupported user coding to Dynamo. 2. Only update GPT2 exporting with real tensor to Config, as FakeMode rises unequal input errors between PyTorch and ORT. The reason is that [non-persistent buffer is not supported](#107211) [ghstack-poisoned]
[ONNX] Add transformers models into no runtime test of fx exporter ghstack-source-id: a404d54be14f9d24966bc59f226431aae19dc0a0 Pull Request resolved: #107247
1. Add a list of HF models to CI tests. The PR intends to build them from Config, but some of them are not supported with Config. NOTE: Loaded from pre-trained model could potentially hit [uint8/bool conflict](huggingface/transformers#21013) when a newer version of transformers is used. - Dolly has torch.fx.Node in OnnxFunction attribute, which is currently not supported. - Falcon and MPT has unsupported user coding to Dynamo. 2. Only update GPT2 exporting with real tensor to Config, as FakeMode rises unequal input errors between PyTorch and ORT. The reason is that [non-persistent buffer is not supported](#107211) [ghstack-poisoned]
[ONNX] Add transformers models into no runtime test of fx exporter ghstack-source-id: fe1a4c2f9d0c554a49047ce4c543444eeb39565c Pull Request resolved: #107247
1. Add a list of HF models to CI tests. The PR intends to build them from Config, but some of them are not supported with Config. NOTE: Loaded from pre-trained model could potentially hit [uint8/bool conflict](huggingface/transformers#21013) when a newer version of transformers is used. - Dolly has torch.fx.Node in OnnxFunction attribute, which is currently not supported. - Falcon and MPT has unsupported user coding to Dynamo. 2. Only update GPT2 exporting with real tensor to Config, as FakeMode rises unequal input errors between PyTorch and ORT. The reason is that [non-persistent buffer is not supported](#107211) [ghstack-poisoned]
[ONNX] Add transformers models into no runtime test of fx exporter ghstack-source-id: 2640837ce94afb45879c22c2f65189dad34d1dd3 Pull Request resolved: #107247
1. Add a list of HF models to CI tests. The PR intends to build them from Config, but some of them are not supported with Config. NOTE: Loaded from pre-trained model could potentially hit [uint8/bool conflict](huggingface/transformers#21013) when a newer version of transformers is used. - Dolly has torch.fx.Node in OnnxFunction attribute, which is currently not supported. - Falcon and MPT has unsupported user coding to Dynamo. 2. Only update GPT2 exporting with real tensor to Config, as FakeMode rises unequal input errors between PyTorch and ORT. The reason is that [non-persistent buffer is not supported](#107211) [ghstack-poisoned]
1. Add a list of HF models to CI tests. The PR intends to build them from Config, but some of them are not supported with Config. NOTE: Loaded from pre-trained model could potentially hit [uint8/bool conflict](huggingface/transformers#21013) when a newer version of transformers is used. - Dolly has torch.fx.Node in OnnxFunction attribute, which is currently not supported. - Falcon and MPT has unsupported user coding to Dynamo. 2. Only update GPT2 exporting with real tensor to Config, as FakeMode rises unequal input errors between PyTorch and ORT. The reason is that [non-persistent buffer is not supported](#107211) [ghstack-poisoned]
1. Add a list of HF models to CI tests. The PR intends to build them from Config, but some of them are not supported with Config. NOTE: Loaded from pre-trained model could potentially hit [uint8/bool conflict](huggingface/transformers#21013) when a newer version of transformers is used. - Dolly has torch.fx.Node in OnnxFunction attribute, which is currently not supported. - Falcon and MPT has unsupported user coding to Dynamo. 2. Only update GPT2 exporting with real tensor to Config, as FakeMode rises unequal input errors between PyTorch and ORT. The reason is that [non-persistent buffer is not supported](#107211) [ghstack-poisoned]
1. Add a list of HF models to CI tests. The PR intends to build them from Config, but some of them are not supported with Config. NOTE: Loaded from pre-trained model could potentially hit [uint8/bool conflict](huggingface/transformers#21013) when a newer version of transformers is used. - Dolly has torch.fx.Node in OnnxFunction attribute, which is currently not supported. - Falcon and MPT has unsupported user coding to Dynamo. 2. Only update GPT2 exporting with real tensor to Config, as FakeMode rises unequal input errors between PyTorch and ORT. The reason is that [non-persistent buffer is not supported](#107211) [ghstack-poisoned]
1. Add a list of HF models to CI tests. The PR intends to build them from Config, but some of them are not supported with Config. NOTE: Loaded from pre-trained model could potentially hit [uint8/bool conflict](huggingface/transformers#21013) when a newer version of transformers is used. - Dolly has torch.fx.Node in OnnxFunction attribute, which is currently not supported. - Falcon and MPT has unsupported user coding to Dynamo. 2. Only update GPT2 exporting with real tensor to Config, as FakeMode rises unequal input errors between PyTorch and ORT. The reason is that [non-persistent buffer is not supported](#107211) [ghstack-poisoned]
# TODO: From Config/Model | ||
@pytorch_test_common.skip_in_ci( | ||
"Skip this test in CI because of memory issue." | ||
"SymFloat in OnnxFUnction attribute is not supported yet." |
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.
def create_kwargs(model_name=model_name): | ||
tokenizer = AutoTokenizer.from_pretrained(model_name) | ||
return tokenizer("Hello world!", return_tensors="pt") | ||
def create_kwargs(): |
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.
In _test_fake_tensor_mode_exporter
, the exported ONNX model and PyTorch model are run and their outputs are compared. However, I am wondering if that really checks dynamic_shapes
. If not, probably with the next (or 2nd next), let's modify create_args
, create_kwargs
, and test_fake_tensor_mode_exporter
to guard dynamic_shapes
supports different batch and sequence sizes.
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.
There is assert_dynamic_shapes
inside the _test_fake_tensor_mode_exporter
should address your concern.
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.
Good first steps to testing important HF models. There are more works required, especially for testing dynamic_shapes=True
+ FakeTensorMode
, but can be done in another PR.
Remember to create issues against proper repos (pytorch, hf, onnx, or ort) for the errors/problems encountered during the test. |
1. Add a list of HF models to CI tests. The PR intends to build them from Config, but some of them are not supported with Config. NOTE: Loaded from pre-trained model could potentially hit [uint8/bool conflict](huggingface/transformers#21013) when a newer version of transformers is used. - Dolly has torch.fx.Node in OnnxFunction attribute, which is currently not supported. - Falcon and MPT has unsupported user coding to Dynamo. 2. Only update GPT2 exporting with real tensor to Config, as FakeMode rises unequal input errors between PyTorch and ORT. The reason is that [non-persistent buffer is not supported](#107211) [ghstack-poisoned]
|
||
def create_model() -> nn.Module: | ||
return transformers.AutoModel.from_pretrained(model_name) | ||
return transformers.AutoModel.from_pretrained(model_name).to(device).eval() |
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.
this still needs to be cached though right?
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.
Oops. Added back the tiny-gpt2 cache.
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.
LG w/ comment on tests with pretrained model and CI caching.
1. Add a list of HF models to CI tests. The PR intends to build them from Config, but some of them are not supported with Config. NOTE: Loaded from pre-trained model could potentially hit [uint8/bool conflict](huggingface/transformers#21013) when a newer version of transformers is used. - Dolly has torch.fx.Node in OnnxFunction attribute, which is currently not supported. - Falcon and MPT has unsupported user coding to Dynamo. 2. Only update GPT2 exporting with real tensor to Config, as FakeMode rises unequal input errors between PyTorch and ORT. The reason is that [non-persistent buffer is not supported](#107211) [ghstack-poisoned]
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Stack from ghstack (oldest at bottom):