From 5e781900fb512a18861121517a1cdcee5a221bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E9=BB=84=E8=89=B2=E8=91=A1=E8=90=84=E7=90=83?= =?UTF-8?q?=E5=90=9B=E5=90=9B?= Date: Tue, 3 Mar 2026 19:05:32 +0800 Subject: [PATCH] Revert "perf(ROCm): optimize chunked CE loss num_warps for RDNA GPUs (#4123)" (#4139) This reverts commit 721bf4852a802da44b78e3b000edd691e5af1d38. --- unsloth/kernels/cross_entropy_loss.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/unsloth/kernels/cross_entropy_loss.py b/unsloth/kernels/cross_entropy_loss.py index 1bb1691776..d92229314f 100644 --- a/unsloth/kernels/cross_entropy_loss.py +++ b/unsloth/kernels/cross_entropy_loss.py @@ -22,7 +22,6 @@ from .utils import ( triton_cast, torch_gpu_device, is_cdna, - is_rdna, ) from transformers.models.llama.modeling_llama import logger from unsloth_zoo.utils import Version @@ -365,7 +364,7 @@ class Fast_CrossEntropyLoss(torch.autograd.Function): SOFTCAP = logit_softcapping, DO_LOGIT_SCALING = DO_LOGIT_SCALING, LOGIT_SCALE = logit_scaling, - num_warps = 16 if is_cdna() or is_rdna() else 32, + num_warps = 32 if not is_cdna() else 16, ) # logsumexp(chunked_logsumexp) - x # Do the -x separately