Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/1xH100_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
gpu-arch-version: ${{ matrix.gpu-arch-version }}
submodules: recursive
script: |
conda create -n venv python=3.9 -y
conda create -n venv python=3.10 -y
conda activate venv
export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/1xL4_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
gpu-arch-version: ${{ matrix.gpu-arch-version }}
submodules: recursive
script: |
conda create -n venv python=3.9 -y
conda create -n venv python=3.10 -y
conda activate venv
export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/4xH100_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
gpu-arch-version: ${{ matrix.gpu-arch-version }}
submodules: recursive
script: |
conda create -n venv python=3.9 -y
conda create -n venv python=3.10 -y
conda activate venv
export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_wheels_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
with-rocm: enable
with-xpu: enable
# Note: if free-threaded python is required add py3.13t here
python-versions: '["3.9"]'
python-versions: '["3.10"]'

build:
needs: generate-matrix
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/regression_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
gpu-arch-version: ${{ matrix.gpu-arch-version }}
submodules: recursive
script: |
conda create -n venv python=3.9 -y
conda create -n venv python=3.10 -y
conda activate venv
python -m pip install --upgrade pip
pip install ${{ matrix.torch-spec }}
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
gpu-arch-version: ${{ matrix.gpu-arch-version }}
submodules: recursive
script: |
conda create -n venv python=3.9 -y
conda create -n venv python=3.10 -y
conda activate venv
echo "::group::Install newer objcopy that supports --set-section-alignment"
dnf install -y gcc-toolset-10-binutils
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression_test_rocm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
docker-image: ${{ matrix.docker-image }}
submodules: recursive
script: |
conda create -n venv python=3.9 -y
conda create -n venv python=3.10 -y
conda activate venv
python -m pip install --upgrade pip
pip install ${{ matrix.torch-spec }}
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

current_date = datetime.now().strftime("%Y%m%d")

PY3_9_HEXCODE = "0x03090000"
min_supported_cpython_hexcode = "0x030A0000" # Python 3.10 hexcode


def get_git_commit_id():
Expand Down Expand Up @@ -398,7 +398,7 @@ def get_extensions():

extra_link_args = []
extra_compile_args = {
"cxx": [f"-DPy_LIMITED_API={PY3_9_HEXCODE}"],
"cxx": [f"-DPy_LIMITED_API={min_supported_cpython_hexcode}"],
"nvcc": nvcc_args if use_cuda else rocm_args,
}

Expand Down Expand Up @@ -781,5 +781,5 @@ def bool_to_on_off(value):
long_description_content_type="text/markdown",
url="https://github.com/pytorch/ao",
cmdclass={"build_ext": TorchAOBuildExt},
options={"bdist_wheel": {"py_limited_api": "cp39"}},
options={"bdist_wheel": {"py_limited_api": "cp310"}},
)
2 changes: 1 addition & 1 deletion test/quantization/pt2e/test_quantize_pt2e_qat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ def _prepare_qat_linears(self, model):
else:
in_channels = child.linear1.weight.size(1)

example_input = (torch.rand((1, in_channels)),)
example_input = (torch.rand((2, 2, 2, in_channels)),)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jerryzh168 Updating shapes here works, and doesn't give the guard dim mismatch error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does it change for 2d to 4d?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The input is 4d, hence converting it to 4d works

example_inputs = (torch.randn(2, 3, 4, 4),)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK so the previous example_input is wrong, wondering why it works before

traced_child = torch.export.export(
child, example_input, strict=True
).module()
Expand Down
2 changes: 2 additions & 0 deletions test/quantization/pt2e/test_x86inductor_fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -2457,6 +2457,8 @@ def forward(self, x):

mod = M().eval()
v = torch.randn((2, 3, 8, 8), dtype=torch.float32, requires_grad=False).add(1)
# Mark the batch dimension (dimension 0) as dynamic for proper dynamic shape testing
torch._dynamo.mark_dynamic(v, 0)
if include_ops is None:
include_ops = [
"torch.ops.onednn.qconv_pointwise",
Expand Down
10 changes: 7 additions & 3 deletions torchao/quantization/pt2e/_numeric_debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,14 @@ def _get_greatest_ancestor_node_source(node: Node) -> "NodeSource":
return node_source

def _is_node_in_original_graph(node: Node) -> bool:
# Handle guard nodes that don't have from_node metadata in newer PyTorch versions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tugsbayasgalan is this change expected? should we using non-strict mode or strict mode?

ep = torch.export.export(m, example_inputs, strict=True)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we made guard checking code as actual node in the graph so it makes sense this node doesn't have FROM_NODE. cc: @avikchaudhuri

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avikchaudhuri What's the best way to update this check?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like the current update is OK

if FROM_NODE_KEY not in node.meta or node.meta[FROM_NODE_KEY] is None:
# Guard nodes (like _guards_fn) created by newer PyTorch versions might not have from_node metadata
# Skip these nodes as they are not part of the original user graph
return False

if (
FROM_NODE_KEY not in node.meta
or node.meta[FROM_NODE_KEY] is None
or node.meta[FROM_NODE_KEY][-1].pass_name
node.meta[FROM_NODE_KEY][-1].pass_name
== "ExportedProgram.module().unlift()"
):
# This node is not part of the ExportedProgram.module().graph, so it doesn't have a debug handle
Expand Down
Loading