Skip to content

[SYCL free func] migrate MultiMarginLoss kernels - #4848

Open
jiafuzha wants to merge 2 commits into
intel:mainfrom
jiafuzha:jiafuzha/142-multimarginloss
Open

[SYCL free func] migrate MultiMarginLoss kernels#4848
jiafuzha wants to merge 2 commits into
intel:mainfrom
jiafuzha:jiafuzha/142-multimarginloss

Conversation

@jiafuzha

@jiafuzha jiafuzha commented Aug 7, 2026

Copy link
Copy Markdown

The two SYCL kernels in this file are free functions (not class functors):
-  multi_margin_loss_forward_kernel 
-  multi_margin_loss_backward_kernel 
- They are annotated with  SYCL_EXT_ONEAPI_FUNCTION_PROPERTY((syclexp::nd_range_kernel<1>)) .

Result of  syclexp::sub_group_size  property check:

  -  syclexp::sub_group_size  is not present in this file.                                              
  - So the kernels are free-function style, but do not have the subgroup-size property.                 
                                                                                                        
 Ran related UTs:                                                                                       
                                                                                                        
  1. In  pytorch                                         
                                                                                                        
  -  pytest test/test_nn.py -v -k "MarginLoss_empty or MarginLoss_race or MarginLoss_warnings"          
  - Result: 2 passed, 3 skipped.                                                                        
                                                                                                        
  2. In current repo       
                                                                                                        
  -  pytest test/xpu/test_nn_xpu.py -v -k "MarginLoss_empty or MarginLoss_race or MarginLoss_warnings"
  - Result: 7 passed, 3 skipped (includes XPU margin-loss coverage).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant