transformers
9572fa2a - Fix CPU forwards when causal-conv1d, mamba-ssm or fla is installed (#50930)

Commit
1 day ago
Fix CPU forwards when causal-conv1d, mamba-ssm or fla is installed (#50930) * Use the torch path for kernel package fallbacks on unsupported devices `use_kernel_func_from_hub_with_fallback` called causal-conv1d, mamba-ssm and fla for inputs on any device, so CPU forwards failed with `Expected x.is_cuda() to be true` once one of them was installed. Each package now lists the device types its kernels run on, and inputs on any other device use the torch implementation, as when the package isn't installed. * Apply review suggestions Call the torch function with the original kwargs on unsupported devices, as on the export path, keep the device lookup inside use_kernel_func_from_hub_with_fallback, and test it next to the export test. Signed-off-by: Kamran Jafari <kjafarisadeg@nvidia.com> * Warn about the fallback on unsupported devices Use one packed-sequence error and one fallback warning for both causes, a missing package or an unsupported device, and check that condition in the if statements directly. Signed-off-by: Kamran Jafari <kjafarisadeg@nvidia.com> --------- Signed-off-by: Kamran Jafari <kjafarisadeg@nvidia.com>
Author
Parents
Loading