File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,31 @@ def supported_dtypes(self) -> list[torch.dtype]:
84
84
shell = True ).strip () == b"1" ):
85
85
return [torch .bfloat16 , torch .float16 , torch .float32 ]
86
86
return [torch .float16 , torch .float32 ]
87
+ elif self .get_cpu_architecture () == CpuArchEnum .RISCV :
88
+ # Workaround for Issue #25655: RISC-V scheduler bug with float16
89
+ #
90
+ # Background:
91
+ # - RISC-V currently uses scalar code path
92
+ # - There is a latent bug in the vLLM scheduler that provides
93
+ # invalid
94
+ # physical_block_idx values under certain conditions
95
+ # - This bug causes segmentation faults when using float16
96
+ # dtype on RISC-V
97
+ # - Testing shows that forcing float32 successfully bypasses
98
+ # this issue
99
+ #
100
+ # Technical details:
101
+ # - The bug manifests as out-of-bounds physical_block_idx in
102
+ # block_tables
103
+ # - Only occurs on RISC-V hardware
104
+ # tested on Sophgo SG2044
105
+ # - Does not reproduce on x86 or other architectures
106
+ # - Root cause is in Python-level scheduling logic,
107
+ # not C++ kernels
108
+ #
109
+ # This is a temporary workaround until the scheduler bug is fixed.
110
+ # See: https://github.com/vllm-project/vllm/issues/25655
111
+ return [torch .float32 ]
87
112
# x86/aarch64 CPU has supported both bf16 and fp16 natively.
88
113
return [torch .bfloat16 , torch .float16 , torch .float32 ]
89
114
You can’t perform that action at this time.
0 commit comments