Skip to content
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

Bump PyTorch to 2.1 #502

Merged
merged 28 commits into from
Apr 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
356ef2a
bump to torch 2.1
JingyaHuang Mar 4, 2024
c81dc3f
skip weights/neff sep test for torch 2.*
JingyaHuang Mar 4, 2024
b9c5325
Merge branch 'main' into bump-to-torch2
JingyaHuang Apr 8, 2024
9e71b27
fix style
JingyaHuang Apr 8, 2024
3eb01fc
fix style
JingyaHuang Apr 8, 2024
f0bda6b
chore(tgi): use pytorch 2
dacorvo Apr 8, 2024
0e96959
test(tgi): update sampling tests expectations
dacorvo Apr 8, 2024
adf7a76
test(tgi): update sampling tests expectations
dacorvo Apr 8, 2024
aecb643
fix(tgi): python3-dev is now required
dacorvo Apr 8, 2024
4701f99
test(tgi): update sampling expectations in integration test
dacorvo Apr 8, 2024
7db7a67
Merge branch 'bump-to-torch2' of https://github.com/huggingface/optim…
JingyaHuang Apr 10, 2024
d708143
Merge branch 'main' into bump-to-torch2
JingyaHuang Apr 10, 2024
fa76578
try fix CIs
JingyaHuang Apr 10, 2024
93eb8af
try+1
JingyaHuang Apr 10, 2024
8462b07
try+1
JingyaHuang Apr 10, 2024
61a5571
try again
JingyaHuang Apr 10, 2024
2ad128e
restore weights/neff sep test
JingyaHuang Apr 10, 2024
89eb09d
Fix gradient checkpoiting for PT 2.1 (and maybe for before as well)
michaelbenayoun Apr 11, 2024
b486187
Merge branch 'bump-to-torch2' of github.com:huggingface/optimum-neuro…
michaelbenayoun Apr 11, 2024
4b2aebb
Fix LLama-2 tracing
michaelbenayoun Apr 11, 2024
b4bd78f
Merge branch 'main' into bump-to-torch2
michaelbenayoun Apr 11, 2024
dbe50bb
Fix distributed tests
michaelbenayoun Apr 12, 2024
ee4678c
Remove XRT server related code
michaelbenayoun Apr 12, 2024
1706415
Merge branch 'main' into bump-to-torch2
michaelbenayoun Apr 12, 2024
a3375d5
test(tgi): update expectations for PT2.1
dacorvo Apr 12, 2024
27a1e38
perf(tgi): update results
dacorvo Apr 12, 2024
971d902
fix: style
dacorvo Apr 12, 2024
6ef1857
tools: remove invalid check
dacorvo Apr 12, 2024
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
Prev Previous commit
Next Next commit
Fix LLama-2 tracing
  • Loading branch information
michaelbenayoun committed Apr 11, 2024
commit 4b2aebb703dc4735df7bfa252a955c6e92223bed
7 changes: 7 additions & 0 deletions optimum/neuron/accelerate/accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,13 @@ def prepare_model(
model.config.output_attentions = False
model.config.output_hidden_states = False

# It is needed for now otherwise sdpa is used since PT > 2.* is available.
for module in model.modules():
if getattr(module, "_use_sdpa", False):
module._use_sdpa = False
if getattr(module, "_use_flash_attention_2", False):
module._use_flash_attention_2 = False

if self.distributed_type is NeuronDistributedType.MODEL_PARALLELISM:
model = self._prepare_model_for_mp(
model, device_placement=device_placement, evaluation_mode=evaluation_mode
Expand Down
Loading