测试集发现了一个 flaot 到 int 转换的问题
python test/test_tensor_creation_ops.py TestTensorCreationCPU.test_float_to_int_conversion_nonfinite_cpu_int16
python
import torch
import math
torch.tensor([math.inf, -math.inf, math.nan]).to(torch.int16)
结果是 tensor([-1, 0, -1], dtype=torch.int16)
在 aten/src/ATen/native/cpu/CopyKernel.cpp 中 的 copy_kernel 函数 iter.has_contiguous_first_dim() 条件为真。
python test/inductor/test_aot_inductor_arrayref.py AOTInductorTestABICompatibleCpuWithStackAllocation.test_misc_1_max_autotune_True_cpu_with_stack_allocationpython test/inductor/test_cpu_select_algorithm.py TestSelectAlgorithmCPU.test_aoti_bmm_unique_identifiers_cpu_float32python test/inductor/test_cpu_select_algorithm.py TestSelectAlgorithmCPU.test_int8_woq_mm_batch_size_17_mid_dim_1_in_features_144_out_features_1024_cpu_bfloat16
>>> L1_cache_size = torch.cpu.get_capabilities().get("l1d_cache_size", 0)
>>> print(L1_cache_size)
0
>>> print(torch.cpu.get_capabilities())
{'l1d_cache_size': 0, 'num_logical_cores': 64, 'num_physical_cores': 64, 'l2_cache_size': 0, 'num_sockets': 1, 'cpu_name': '', 'architecture': 'riscv64'}
测试在读 cpuinfo 的时候读到L1 cache size是0,还有救
python test/inductor/test_binary_folding.py FreezingCpuTests.test_conv_binary_folding_cpu
看起来是精度问题,可能也得救
python test/inductor/test_compile_subprocess.py CpuTests.test_remove_noop_slice1_cpu图生成失败问题,log里建议重新跑
python test/inductor/test_cpu_repro.py CPUReproTests.test_broadcast_scalar_cpp_tile_2d_kernel精度问题
python test/inductor/test_cpu_repro.py CPUReproTests.test_tanh_atan2_use_decompose_tanh AssertionError: AssertionError not raised
FAILED [0.0074s] inductor/test_extension_backend.py::ExtensionBackendTests::test_open_device_registration - RuntimeError: The runtime module of 'extension_device' has already been registered with '<module 'extension_device' from '/home/chenyixuan/.cache/torch_extensions/py311_cpu/extension_device/extension_device.so'>'
To execute this test, run the following from the base repo dir:
python test/inductor/test_extension_backend.py ExtensionBackendTests.test_open_device_registration
和预期值不相等,待分析
__________________ TestExperimentalUtils.test_fuzz_symbolize ___________________
Traceback (most recent call last):
File "/usr/lib64/python3.11/unittest/case.py", line 57, in testPartExecutor
yield
File "/usr/lib64/python3.11/unittest/case.py", line 623, in run
self._callTestMethod(testMethod)
File "/usr/lib64/python3.11/unittest/case.py", line 579, in _callTestMethod
if method() is not None:
^^^^^^^^
File "/home/chenyixuan/pytorch/torch/testing/_internal/common_utils.py", line 3368, in wrapper
method(*args, **kwargs)
File "/home/chenyixuan/pytorch/test/profiler/test_profiler.py", line 3386, in test_fuzz_symbolize
self.assertEqual(len(fast), len(addrs))
File "/home/chenyixuan/pytorch/torch/testing/_internal/common_utils.py", line 4363, in assertEqual
raise error_metas.pop()[0].to_error( # type: ignore[index]
AssertionError: Scalars are not equal!
Expected 200 but got 0.
Absolute difference: 200
Relative difference: 1.0
精度转换问题
=================================== FAILURES ===================================
_____________ TestBinaryUfuncsCPU.test_copysign_cpu_float32_int32 ______________
Traceback (most recent call last):
File "/usr/lib64/python3.11/unittest/case.py", line 57, in testPartExecutor
yield
File "/usr/lib64/python3.11/unittest/case.py", line 623, in run
self._callTestMethod(testMethod)
File "/usr/lib64/python3.11/unittest/case.py", line 579, in _callTestMethod
if method() is not None:
^^^^^^^^
File "/home/chenyixuan/pytorch/torch/testing/_internal/common_utils.py", line 3368, in wrapper
method(*args, **kwargs)
File "/home/chenyixuan/pytorch/torch/testing/_internal/common_device_type.py", line 430, in instantiated_test
result = test(self, **param_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chenyixuan/pytorch/test/test_binary_ufuncs.py", line 2571, in test_copysign
_test_copysign_numpy(
File "/home/chenyixuan/pytorch/test/test_binary_ufuncs.py", line 2541, in _test_copysign_numpy
self.assertEqual(
File "/home/chenyixuan/pytorch/torch/testing/_internal/common_utils.py", line 4363, in assertEqual
raise error_metas.pop()[0].to_error( # type: ignore[index]
AssertionError: Tensor-likes are not close!
Mismatched elements: 51 / 100 (51.0%)
Greatest absolute difference: 2.0 at index (0, 0) (up to 1e-07 allowed)
Greatest relative difference: 2.0 at index (0, 0) (up to 1e-07 allowed)
To execute this test, run the following from the base repo dir:
python test/test_binary_ufuncs.py TestBinaryUfuncsCPU.test_copysign_cpu_float32_int32