Skip to content

Add clone -> fd.ops.set translation for nvFuser#1685

Merged
t-vi merged 2 commits intoLightning-AI:mainfrom
IvanYashchuk:nvfuser-clone
Jan 23, 2025
Merged

Add clone -> fd.ops.set translation for nvFuser#1685
t-vi merged 2 commits intoLightning-AI:mainfrom
IvanYashchuk:nvfuser-clone

Conversation

@IvanYashchuk
Copy link
Collaborator

This PR allows the nvFuser fusion pass to consume the prims.clone operation (a decomposition from torch.clone).

The tests already exist with pytest thunder/tests/test_ops.py -k "test_core_vs_torch_consistency_clone_nvfuser_cuda_thunder":

thunder/tests/test_ops.py::test_core_vs_torch_consistency_clone_nvfuser_cuda_thunder::dtypes::bfloat16 <- thunder/tests/framework.py PASSED
thunder/tests/test_ops.py::test_core_vs_torch_consistency_clone_nvfuser_cuda_thunder::dtypes::bool8 <- thunder/tests/framework.py PASSED
thunder/tests/test_ops.py::test_core_vs_torch_consistency_clone_nvfuser_cuda_thunder::dtypes::complex128 <- thunder/tests/framework.py SKIPPED (Skipping complex operator tests in CI for speed)
thunder/tests/test_ops.py::test_core_vs_torch_consistency_clone_nvfuser_cuda_thunder::dtypes::complex64 <- thunder/tests/framework.py SKIPPED (Skipping complex operator tests in CI for speed)
thunder/tests/test_ops.py::test_core_vs_torch_consistency_clone_nvfuser_cuda_thunder::dtypes::float16 <- thunder/tests/framework.py PASSED
thunder/tests/test_ops.py::test_core_vs_torch_consistency_clone_nvfuser_cuda_thunder::dtypes::float32 <- thunder/tests/framework.py PASSED
thunder/tests/test_ops.py::test_core_vs_torch_consistency_clone_nvfuser_cuda_thunder::dtypes::float64 <- thunder/tests/framework.py PASSED
thunder/tests/test_ops.py::test_core_vs_torch_consistency_clone_nvfuser_cuda_thunder::dtypes::int32 <- thunder/tests/framework.py PASSED
thunder/tests/test_ops.py::test_core_vs_torch_consistency_clone_nvfuser_cuda_thunder::dtypes::int64 <- thunder/tests/framework.py PASSED

=========================================================================== 7 passed, 2 skipped, 6755 deselected, 380 warnings in 2.32s

Fixes #1675.

Copy link
Collaborator

@t-vi t-vi left a comment

Choose a reason for hiding this comment

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

Thank you @IvanYashchuk

@t-vi t-vi enabled auto-merge (squash) January 23, 2025 15:33
@t-vi
Copy link
Collaborator

t-vi commented Jan 23, 2025

FAILED thunder/tests/test_networks.py::test_hf_llama - AssertionError: assert 6 == 7
 +  where 6 = len(['nvFusion1', 'nvFusion6', 'nvFusion0', 'nvFusion2', 'nvFusion3', 'nvFusion5'])

should be benign (but maybe good to look which fusions get generated) but needs an update

@t-vi t-vi merged commit c951fdb into Lightning-AI:main Jan 23, 2025
49 checks passed
@IvanYashchuk IvanYashchuk deleted the nvfuser-clone branch January 24, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connect torch.clone (prims.clone) to nvFuser

2 participants

Comments