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

[DO NOT MERGE] 2.7 RC Test #3301

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions .ci/docker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ datasets
transformers
torchmultimodal-nightly # needs to be updated to stable as soon as it's avaialable
onnx
onnxscript
onnxscript>=0.2.2
onnxruntime
evaluate
accelerate>=0.20.1
Expand Down Expand Up @@ -69,5 +69,5 @@ pycocotools
semilearn==0.3.2
torchao==0.5.0
segment_anything==1.0
torchrec==1.0.0; platform_system == "Linux"
torchrec==1.1.0; platform_system == "Linux"
fbgemm-gpu==1.1.0; platform_system == "Linux"
12 changes: 8 additions & 4 deletions .jenkins/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ sudo apt-get install -y pandoc
#Install PyTorch Nightly for test.
# Nightly - pip install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html
# Install 2.5 to merge all 2.4 PRs - uncomment to install nightly binaries (update the version as needed).
# sudo pip uninstall -y torch torchvision torchaudio torchtext torchdata
# sudo pip3 install torch==2.6.0 torchvision --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu124
# sudo pip uninstall -y fbgemm-gpu torchrec
# sudo pip3 install fbgemm-gpu==1.1.0 torchrec==1.0.0 --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu124
sudo pip uninstall -y torch torchvision torchaudio torchtext torchdata torchrl tensordict
pip3 install torch==2.7.0 torchvision torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu126
#sudo pip uninstall -y fbgemm-gpu
#sudo pip3 install --pre fbgemm-gpu --index-url https://download.pytorch.org/whl/nightly/cu126/
#pip install tensordict-nightly
#pip install torchrl-nightly
#sudo pip3 install fbgemm-gpu==1.1.0 torchrec==1.0.0 --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu126


# Install two language tokenizers for Translation with TorchText tutorial
python -m spacy download en_core_web_sm
Expand Down
9 changes: 8 additions & 1 deletion .jenkins/validate_tutorials_built.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@
"intermediate_source/flask_rest_api_tutorial",
"intermediate_source/text_to_speech_with_torchaudio",
"intermediate_source/tensorboard_profiler_tutorial", # reenable after 2.0 release.
"advanced_source/semi_structured_sparse" # reenable after 3303 is fixed.
"advanced_source/semi_structured_sparse", # reenable after 3303 is fixed.
"intermediate_source/mario_rl_tutorial", # reenable after 3302 is fixed
"intermediate_source/reinforcement_ppo", # reenable after 3302 is fixed
"intermediate_source/pinmem_nonblock", # reenable after 3302 is fixed
"intermediate_source/dqn_with_rnn_tutorial", # reenable after 3302 is fixed
"advanced_source/pendulum", # reenable after 3302 is fixed
"advanced_source/coding_ddpg", # reenable after 3302 is fixed
"intermediate_source/torchrec_intro_tutorial" # reenable after 3302 is fixed
]

def tutorial_source_dirs() -> List[Path]:
Expand Down
2 changes: 1 addition & 1 deletion intermediate_source/torch_export_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ def forward(self, x):
# with torch.no_grad():
# pt2_path = torch._inductor.aoti_compile_and_package(ep)
#
# # Load and run the .so file in Python.
# # Load and run the .pt2 file in Python.
# # To load and run it in a C++ environment, see:
# # https://pytorch.org/docs/main/torch.compiler_aot_inductor.html
# aoti_compiled = torch._inductor.aoti_load_package(pt2_path)
Expand Down
8 changes: 4 additions & 4 deletions recipes_source/torch_export_aoti_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
model_path = os.path.join(os.getcwd(), "resnet18.pt2")

compiled_model = torch._inductor.aoti_load_package(model_path)
example_inputs = (torch.randn(2, 3, 224, 224, device=device),)
example_inputs = torch.randn(2, 3, 224, 224, device=device)

with torch.inference_mode():
output = compiled_model(example_inputs)
Expand Down Expand Up @@ -238,11 +238,11 @@ def timed(fn):

torch._dynamo.reset()

model = torch._inductor.aoti_load_package(model_path)
example_inputs = (torch.randn(1, 3, 224, 224, device=device),)
compiled_model = torch._inductor.aoti_load_package(model_path)
example_inputs = torch.randn(1, 3, 224, 224, device=device)

with torch.inference_mode():
_, time_taken = timed(lambda: model(example_inputs))
_, time_taken = timed(lambda: compiled_model(example_inputs))
print(f"Time taken for first inference for AOTInductor is {time_taken:.2f} ms")


Expand Down
Loading