pytorch - 💡(How to fix) Fix `"index_copy_cpu"` not implemented for `'Float8_e5m2'`

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Traceback (most recent call last): File "bug.py", line 6, in <module> torch.index_copy(input, 0, index, source) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^ NotImplementedError: "index_copy_cpu" not implemented for 'Float8_e5m2'

Code Example

import torch

input = torch.empty(1, dtype=torch.float8_e5m2)
index = torch.tensor([0])
source = torch.empty(1, dtype=torch.float8_e5m2)
torch.index_copy(input, 0, index, source)

---

Traceback (most recent call last):
  File "bug.py", line 6, in <module>
    torch.index_copy(input, 0, index, source)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
NotImplementedError: "index_copy_cpu" not implemented for 'Float8_e5m2'

---

Collecting environment information...
PyTorch version: 2.13.0.dev20260420
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 26.3.1 (arm64)
GCC version: Could not collect
Clang version: 17.0.0 (clang-1700.6.3.2)
CMake version: version 4.2.3
Libc version: N/A

Python version: 3.14.2 (v3.14.2:df793163d58, Dec  5 2025, 12:18:06) [Clang 16.0.0 (clang-1600.0.26.6)] (64-bit runtime)
Python platform: macOS-26.3.1-arm64-arm-64bit-Mach-O
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
Is XPU available: False
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
Caching allocator config: N/A

CPU:
Apple M4 Pro

Versions of relevant libraries:
[pip3] Could not collect
[conda] Could not collect
RAW_BUFFERClick to expand / collapse

🐛 Describe the bug

import torch

input = torch.empty(1, dtype=torch.float8_e5m2)
index = torch.tensor([0])
source = torch.empty(1, dtype=torch.float8_e5m2)
torch.index_copy(input, 0, index, source)

Error logs

Traceback (most recent call last):
  File "bug.py", line 6, in <module>
    torch.index_copy(input, 0, index, source)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
NotImplementedError: "index_copy_cpu" not implemented for 'Float8_e5m2'

Versions

Collecting environment information...
PyTorch version: 2.13.0.dev20260420
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 26.3.1 (arm64)
GCC version: Could not collect
Clang version: 17.0.0 (clang-1700.6.3.2)
CMake version: version 4.2.3
Libc version: N/A

Python version: 3.14.2 (v3.14.2:df793163d58, Dec  5 2025, 12:18:06) [Clang 16.0.0 (clang-1600.0.26.6)] (64-bit runtime)
Python platform: macOS-26.3.1-arm64-arm-64bit-Mach-O
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
Is XPU available: False
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
Caching allocator config: N/A

CPU:
Apple M4 Pro

Versions of relevant libraries:
[pip3] Could not collect
[conda] Could not collect

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @jerryzh168 @aditew01

extent analysis

TL;DR

The NotImplementedError for index_copy_cpu with Float8_e5m2 data type suggests that the current PyTorch version does not support this operation for the specified data type.

Guidance

  • The error message indicates that the index_copy function is not implemented for the Float8_e5m2 data type on the CPU, suggesting a limitation in the current PyTorch version.
  • Verify if the operation is supported on other data types, such as float32 or float64, to isolate the issue.
  • Consider using a different data type for the input, index, and source tensors if possible.
  • Check the PyTorch documentation or issue tracker for any updates or workarounds related to this specific data type and operation.

Example

# Example of using a different data type
input = torch.empty(1, dtype=torch.float32)
index = torch.tensor([0])
source = torch.empty(1, dtype=torch.float32)
torch.index_copy(input, 0, index, source)

Notes

The issue seems to be specific to the Float8_e5m2 data type and the index_copy operation on the CPU. The provided PyTorch version is a development build, which might not have all features fully implemented.

Recommendation

Apply workaround: Use a different data type, such as float32, if possible, as shown in the example code snippet. This is because the current PyTorch version does not support the index_copy operation for the Float8_e5m2 data type.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - 💡(How to fix) Fix `"index_copy_cpu"` not implemented for `'Float8_e5m2'`