diff --git a/python/sglang/srt/layers/attention/double_sparsity_backend.py b/python/sglang/srt/layers/attention/double_sparsity_backend.py index 76a63a093..e8ee1538b 100644 --- a/python/sglang/srt/layers/attention/double_sparsity_backend.py +++ b/python/sglang/srt/layers/attention/double_sparsity_backend.py @@ -32,7 +32,7 @@ class DoubleSparseAttnBackend(AttentionBackend): self.heavy_token_num = model_runner.server_args.ds_heavy_token_num self.sorted_channels = model_runner.sorted_channels - self.sparse_decode_thresold = ( + self.sparse_decode_threshold = ( model_runner.server_args.ds_sparse_decode_threshold ) self.att_out_approx: torch.Tensor = None @@ -210,7 +210,7 @@ class DoubleSparseAttnBackend(AttentionBackend): # and set a minimum value for sparse_decode if ( min_seq_len < self.heavy_token_num - or max_seq_len < self.sparse_decode_thresold + or max_seq_len < self.sparse_decode_threshold ): self.decode_attention_fwd( q.view(-1, layer.tp_q_head_num, layer.qk_head_dim), diff --git a/python/sglang/srt/layers/quantization/fp8_kernel.py b/python/sglang/srt/layers/quantization/fp8_kernel.py index 2022c3e8b..95d8ac46a 100644 --- a/python/sglang/srt/layers/quantization/fp8_kernel.py +++ b/python/sglang/srt/layers/quantization/fp8_kernel.py @@ -219,7 +219,7 @@ def _per_token_group_quant_8bit_raw( quantized tensor along with the scaling factor used for quantization. Args: - x: The input tenosr with ndim >= 2. + x: The input tensor with ndim >= 2. group_size: The group size used for quantization. eps: The minimum to avoid dividing zero. dtype: The dype of output tensor. @@ -635,7 +635,7 @@ def static_quant_fp8( quantized tensor along with the scaling factor used for quantization. Args: - x: The input tenosr with ndim >= 2. + x: The input tensor with ndim >= 2. x_s: The quantization scale. repeat_scale: Whether to broadcast per-tensor scale to per-channel scale. dtype: The dype of output tensor. diff --git a/python/sglang/srt/layers/quantization/int8_kernel.py b/python/sglang/srt/layers/quantization/int8_kernel.py index 91cba1c32..9a122cad5 100644 --- a/python/sglang/srt/layers/quantization/int8_kernel.py +++ b/python/sglang/srt/layers/quantization/int8_kernel.py @@ -143,7 +143,7 @@ def per_token_group_quant_int8( quantized tensor along with the scaling factor used for quantization. Args: - x: The input tenosr with ndim >= 2. + x: The input tensor with ndim >= 2. group_size: The group size used for quantization. eps: The minimum to avoid dividing zero. dtype: The dype of output tensor. Note that only `torch.int8` is supported for now. diff --git a/python/sglang/srt/layers/quantization/quark/utils.py b/python/sglang/srt/layers/quantization/quark/utils.py index 6f7d25c73..e3a9cd6e6 100644 --- a/python/sglang/srt/layers/quantization/quark/utils.py +++ b/python/sglang/srt/layers/quantization/quark/utils.py @@ -128,10 +128,10 @@ def b_dynamic_mxfp4_quant(x): return x.view(h, b, d // 2), x_scales.view(h, b, d // 32) -def mxfp4_to_f32(x, is_threed): +def mxfp4_to_f32(x, is_3d): # 2 because we pack fp4 in uint8. x = x.repeat_interleave(2, dim=-1) - if is_threed: + if is_3d: x[..., ::2] = x[..., ::2] & 0xF x[..., 1::2] = x[..., 1::2] >> 4 else: diff --git a/python/sglang/srt/managers/io_struct.py b/python/sglang/srt/managers/io_struct.py index c8074fa86..2135f5ecf 100644 --- a/python/sglang/srt/managers/io_struct.py +++ b/python/sglang/srt/managers/io_struct.py @@ -1271,7 +1271,7 @@ class UpdateWeightFromDiskReqInput(BaseReq): torch_empty_cache: bool = False # Whether to keep the scheduler paused after weight update keep_pause: bool = False - # Whether to recapture cuda graph after weight udpdate + # Whether to recapture cuda graph after weight update recapture_cuda_graph: bool = False # The trainer step id. Used to know which step's weights are used for sampling. token_step: int = 0 diff --git a/test/registered/rl/test_multi_instance_release_memory_occupation.py b/test/registered/rl/test_multi_instance_release_memory_occupation.py index baf614508..da66b6ca6 100644 --- a/test/registered/rl/test_multi_instance_release_memory_occupation.py +++ b/test/registered/rl/test_multi_instance_release_memory_occupation.py @@ -32,7 +32,7 @@ TEST_SUITE = dict( class EngineWrapper: """ - A wrapper around Sglang engine to mock multi instance cases such as RL traing. + A wrapper around Sglang engine to mock multi instance cases such as RL training. """ diff --git a/test/registered/utils/test_bench_typebaseddispatcher.py b/test/registered/utils/test_bench_typebaseddispatcher.py index 2feeaf79c..02cccc4dc 100644 --- a/test/registered/utils/test_bench_typebaseddispatcher.py +++ b/test/registered/utils/test_bench_typebaseddispatcher.py @@ -198,17 +198,17 @@ def test_edge_case(): assert result1 == result2 print("Pass for normal test") - class UnkownType: + class UnknownType: pass try: - list_dispatcher(UnkownType()) + list_dispatcher(UnknownType()) print("exception was thrown from list version as expected") except ValueError: print("exception thrown from list version was processed...") try: - dict_dispatcher(UnkownType()) + dict_dispatcher(UnknownType()) print("exception was thrown from dict version as expected") except ValueError: print("exception thrown from dict version was processed...")