Skip to content

[SYCL free func] migrate AmpKernels kernels - #4864

Open
minmingzhu wants to merge 1 commit into
mainfrom
minmingz/amp_free_function
Open

[SYCL free func] migrate AmpKernels kernels#4864
minmingzhu wants to merge 1 commit into
mainfrom
minmingz/amp_free_function

Conversation

@minmingzhu

@minmingzhu minmingzhu commented Aug 7, 2026

Copy link
Copy Markdown

AmpKernels.cpp — Kernel UT Report

  • SYCL kernel conversion check: In src/ATen/native/xpu/sycl/AmpKernels.cpp, amp_update_scale_ff_kernel (line 118) is implemented/launched as a free function via SYCL_EXT_ONEAPI_FUNCTION_PROPERTY((syclexp::nd_range_kernel<1>)) and sycl_kernel_submit<amp_update_scale_ff_kernel>(...) function pointer.

  • The remaining *Functor structs in this file (AmpNonFiniteCheckUnscaleFunctor, AmpForeachNonFiniteCheckUnscaleFunctor) are element-wise operation functors passed to gpu_kernel() / multi_tensor_apply() (TensorIterator/foreach infrastructure) and are not SYCL kernel launch functors.

  • Changed-kernel related UTs run in both locations:

  1. In PyTorch (/workspace1/minminz/workpath/pytorch-public):
    • pytest test/test_xpu.py -v -k "grad_scal or GradScal or amp"
    • Result: 16 passed, 170 deselected, 2 xfailed.
  2. In current repo (torch-xpu-ops):
    • pytest test/xpu/test_autocast_xpu.py -v
    • Result: 26 passed, 3 skipped.
  3. Functional verification (GradScaler step/update on XPU):
    • Normal path: scale remains 4.0 ✓
    • Inf-detected path: scale correctly backed off to 2.0 ✓

@github-actions github-actions Bot added disable_e2e Disable all e2e test jobs for the PR disable_distributed Disable distributed UT test jobs for the PR labels Aug 7, 2026
@minmingzhu
minmingzhu marked this pull request as draft August 7, 2026 10:35
@minmingzhu
minmingzhu marked this pull request as ready for review August 10, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disable_distributed Disable distributed UT test jobs for the PR disable_e2e Disable all e2e test jobs for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants