Skip to content

Commit 2ddc290

Browse files
authored
Merge branch 'main' into mgs28-char-rnn-update
2 parents 63cd021 + f2d5a6a commit 2ddc290

File tree

81 files changed

+1574
-5531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1574
-5531
lines changed

.ci/docker/Dockerfile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,11 @@ RUN bash ./install_user.sh && rm install_user.sh
1515
COPY ./common/install_docs_reqs.sh install_docs_reqs.sh
1616
RUN bash ./install_docs_reqs.sh && rm install_docs_reqs.sh
1717

18-
# Install conda and other packages
19-
ENV ANACONDA_PYTHON_VERSION=3.10
20-
ENV CONDA_CMAKE yes
21-
ENV DOCS yes
22-
ENV PATH /opt/conda/envs/py_$ANACONDA_PYTHON_VERSION/bin:/opt/conda/bin:$PATH
23-
COPY ./requirements.txt /opt/conda/
24-
COPY ./common/install_conda.sh install_conda.sh
25-
COPY ./common/common_utils.sh common_utils.sh
26-
RUN bash ./install_conda.sh && rm install_conda.sh common_utils.sh /opt/conda/requirements.txt
18+
COPY ./common/install_pip_requirements.sh install_pip_requirements.sh
19+
COPY ./requirements.txt requirements.txt
20+
RUN bash ./install_pip_requirements.sh && rm install_pip_requirements.sh
21+
22+
RUN ln -s /usr/bin/python3 /usr/bin/python
2723

2824
USER ci-user
2925
CMD ["bash"]

.ci/docker/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set -exu
1010
IMAGE_NAME="$1"
1111
shift
1212

13-
export UBUNTU_VERSION="20.04"
13+
export UBUNTU_VERSION="22.04"
1414
export CUDA_VERSION="12.4.1"
1515

1616
export BASE_IMAGE="nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}"

.ci/docker/common/common_utils.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

.ci/docker/common/install_base.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ install_ubuntu() {
1010
apt-get install -y --no-install-recommends \
1111
build-essential \
1212
ca-certificates \
13-
cmake=3.16* \
13+
cmake=3.22* \
1414
curl \
1515
git \
1616
wget \
@@ -27,7 +27,9 @@ install_ubuntu() {
2727
libglfw3-dev \
2828
sox \
2929
libsox-dev \
30-
libsox-fmt-all
30+
libsox-fmt-all \
31+
python3-pip \
32+
python3-dev
3133

3234
# Cleanup package manager
3335
apt-get autoclean && apt-get clean

.ci/docker/common/install_conda.sh

Lines changed: 0 additions & 55 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
# Install pip packages
6+
pip install --upgrade pip
7+
pip install -r ./requirements.txt

.jenkins/metadata.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
"recipes_source/torch_export_aoti_python.py": {
3535
"needs": "linux.g5.4xlarge.nvidia.gpu"
36-
},
36+
},
3737
"advanced_source/pendulum.py": {
3838
"needs": "linux.g5.4xlarge.nvidia.gpu",
3939
"_comment": "need to be here for the compiling_optimizer_lr_scheduler.py to run."
@@ -58,6 +58,9 @@
5858
"intermediate_source/scaled_dot_product_attention_tutorial.py": {
5959
"needs": "linux.g5.4xlarge.nvidia.gpu"
6060
},
61+
"intermediate_source/transformer_building_blocks.py": {
62+
"needs": "linux.g5.4xlarge.nvidia.gpu"
63+
},
6164
"recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py": {
6265
"needs": "linux.g5.4xlarge.nvidia.gpu"
6366
},

.jenkins/validate_tutorials_built.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
NOT_RUN = [
1212
"beginner_source/basics/intro", # no code
13+
"beginner_source/introyt/introyt_index", # no code
1314
"beginner_source/onnx/intro_onnx",
1415
"beginner_source/profiler",
1516
"beginner_source/saving_loading_models",
@@ -24,6 +25,7 @@
2425
"intermediate_source/mnist_train_nas", # used by ax_multiobjective_nas_tutorial.py
2526
"intermediate_source/fx_conv_bn_fuser",
2627
"intermediate_source/_torch_export_nightly_tutorial", # does not work on release
28+
"intermediate_source/transformer_building_blocks", # does not work on release
2729
"advanced_source/super_resolution_with_onnxruntime",
2830
"advanced_source/usb_semisup_learn", # fails with CUDA OOM error, should try on a different worker
2931
"prototype_source/fx_graph_mode_ptq_dynamic",

.lycheeignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ file:///f:/libtmp/some_file
66

77
#Ignore links with "file:///" to catch any other example links
88
file:\/\/\/.*
9+
10+
# Ignore colab link in the setting of conf.py
11+
https://pytorch.org/tutorials/beginner/colab/n
12+
13+
# Ignore local host link from intermediate_source/tensorboard_tutorial.rst
14+
http://localhost:6006

_static/css/custom.css

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,22 +93,5 @@
9393
}
9494

9595
.pytorch-left-menu-search input[type=text] {
96-
background-image: none;
97-
}
98-
99-
.gsc-control-cse {
100-
padding-left: 0px !important;
101-
padding-bottom: 0px !important;
102-
}
103-
104-
.gsc-search-button .gsc-search-button-v2:focus {
105-
border: transparent !important;
106-
outline: none;
107-
box-shadow: none;
108-
}
109-
.gsc-search-button-v2:active {
110-
border: none !important;
111-
}
112-
.gsc-search-button-v2 {
113-
border: none !important;
96+
background-image: url("../images/search-icon.svg");
11497
}

_static/css/custom2.css

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,96 @@
1717
margin-bottom: 5px;
1818
}
1919
}
20+
21+
/* Left nav for 2nd level nav */
22+
23+
.pytorch-left-menu li.toctree-l2 {
24+
padding-left: 10px;
25+
}
26+
27+
.pytorch-left-menu li.toctree-l2.current > a, {
28+
color: #ee4c2c;
29+
}
30+
31+
.pytorch-left-menu li.toctree-l2.current a:link.reference.internal {
32+
color: #ee4c2c;
33+
}
34+
35+
.pytorch-left-menu li.toctree-l1.current > a:before {
36+
content: "";
37+
}
38+
39+
/* search radio button*/
40+
41+
input[type="radio"] {
42+
accent-color: #ee4c2c;
43+
}
44+
45+
.gsst_b {
46+
display: none;
47+
}
48+
49+
#gsc-i-id1 {
50+
height: 1.5rem;
51+
text-indent: 12px !important;
52+
font-size: 1rem !important;
53+
font-family: "FreightSansi";
54+
background-image: url(../images/search-icon.svg) !important;
55+
background-repeat: no-repeat !important;
56+
background-size: 18px 18px !important;
57+
background-position: 5px 0px !important;
58+
padding-left: 20px !important;
59+
}
60+
61+
#gsc-i-id1::placeholder {
62+
font-family: 'FreightSans';
63+
font-size: 1rem;
64+
color: #262626;
65+
}
66+
67+
.gsc-control-cse {
68+
padding: 0 !important;
69+
border-radius: 0px !important;
70+
border: none !important;
71+
}
72+
73+
.gsc-overflow-hidden {
74+
overflow: visible !important;
75+
}
76+
77+
#___gcse_0 {
78+
height: 44px !important;
79+
padding: 0 !important;
80+
}
81+
82+
table.gsc-search-box td.gsc-input {
83+
padding-right: 0 !important;
84+
}
85+
86+
table.gsc-search-box td {
87+
height: 44px;
88+
margin-bottom: 0 !important;
89+
padding-bottom: 0 !important;
90+
}
91+
92+
.gsc-search-button-v2 {
93+
display: none;
94+
}
95+
96+
.gs_id50 {
97+
width: 308px;
98+
}
99+
100+
.gsib_a {
101+
padding: 0px 8px 4px 9px !important;
102+
}
103+
104+
.gsc-input-box {
105+
border-radius: 0px !important;
106+
border: none !important;
107+
}
108+
109+
form.gsc-search-box {
110+
margin-bottom 0px;
111+
}
112+

_static/js/custom.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
document.addEventListener("DOMContentLoaded", function() {
2+
// Select all <li> elements with the class "toctree-l1"
3+
var toctreeItems = document.querySelectorAll('li.toctree-l1');
4+
5+
toctreeItems.forEach(function(item) {
6+
// Find the link within the item
7+
var link = item.querySelector('a');
8+
var nestedList = item.querySelector('ul');
9+
10+
if (link && nestedList) {
11+
// Create a span element for the "[+]" or "[-]" sign
12+
var expandSign = document.createElement('span');
13+
expandSign.style.cursor = 'pointer'; // Make it look clickable
14+
15+
// Use the link text as a unique key for localStorage
16+
var sectionKey = 'section_' + link.textContent.trim().replace(/\s+/g, '_');
17+
18+
// Retrieve the saved state from localStorage
19+
var isExpanded = localStorage.getItem(sectionKey);
20+
21+
// If no state is saved, default to expanded for "Learn the Basics" and collapsed for others
22+
if (isExpanded === null) {
23+
isExpanded = (link.textContent.trim() === 'Learn the Basics') ? 'true' : 'false';
24+
localStorage.setItem(sectionKey, isExpanded);
25+
}
26+
27+
if (isExpanded === 'true') {
28+
nestedList.style.display = 'block'; // Expand the section
29+
expandSign.textContent = '[-] '; // Show "[-]" since it's expanded
30+
} else {
31+
nestedList.style.display = 'none'; // Collapse the section
32+
expandSign.textContent = '[+] '; // Show "[+]" since it's collapsed
33+
}
34+
35+
// Add a click event to toggle the nested list
36+
expandSign.addEventListener('click', function() {
37+
if (nestedList.style.display === 'none') {
38+
nestedList.style.display = 'block';
39+
expandSign.textContent = '[-] '; // Change to "[-]" when expanded
40+
localStorage.setItem(sectionKey, 'true'); // Save state
41+
} else {
42+
nestedList.style.display = 'none';
43+
expandSign.textContent = '[+] '; // Change back to "[+]" when collapsed
44+
localStorage.setItem(sectionKey, 'false'); // Save state
45+
}
46+
});
47+
48+
// Insert the sign before the link
49+
link.parentNode.insertBefore(expandSign, link);
50+
}
51+
});
52+
});

0 commit comments

Comments
 (0)