mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[fbgemm_gpu] Replace C10_CUDA_KERNEL_LAUNCH_CHECK() in the KernelLauncher (#153178)
Summary: - Replace `C10_CUDA_KERNEL_LAUNCH_CHECK()` in the `KernelLauncher`, as the latter does not print __FILE__ and __LINE__ The existing `C10_CUDA_KERNEL_LAUNCH_CHECK()` implementation does not print the source file and line number when a CUDA kernel launch throws an error, leaving users confused with a context-less message like `CUDA error: invalid arguments`. This new check is a slimmed re-implementation of the macro with extra context information added to the error (beyond just file and line number) so that we can at least locate the FBGEMM source file or template where the error first surfaces. Test Plan: ``` buck2 run 'fbcode//mode/opt' fbcode//deeplearning/fbgemm/fbgemm_gpu/test/utils:kernel_launcher buck2 run 'fbcode//mode/opt-amd-gpu' fbcode//deeplearning/fbgemm/fbgemm_gpu/test/utils:kernel_launcher ``` Reviewed By: sryap Differential Revision: D74364031 Pull Request resolved: https://github.com/pytorch/pytorch/pull/153178 Approved by: https://github.com/atalman, https://github.com/huydhn
This commit is contained in:
committed by
PyTorch MergeBot
parent
595e21a9dd
commit
192f7140d1
@ -8749,6 +8749,7 @@ C10_MAPPINGS = collections.OrderedDict(
|
||||
("CUDAAllocator", ("HIPAllocator", API_C10)),
|
||||
("C10_CUDA_KERNEL_LAUNCH_CHECK", ("C10_HIP_KERNEL_LAUNCH_CHECK", API_C10)),
|
||||
("CUDAKernelLaunchRegistry", ("HIPKernelLaunchRegistry", API_C10)),
|
||||
("c10::cuda::get_cuda_check_suffix", ("c10::hip::get_hip_check_suffix", API_C10)),
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user