Skip to content

Commit

Permalink
fix: use fp16 dtype for sm75 (#1136)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyncs authored Aug 17, 2024
1 parent 5d0d40d commit 9208591
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/sglang/srt/model_executor/model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ def load_model(self):
f"[gpu={self.gpu_id}] Load weight begin. "
f"avail mem={get_available_gpu_memory(self.gpu_id):.2f} GB"
)
if torch.cuda.get_device_capability()[0] < 8:
logger.info(
"Compute capability below sm80 use float16 due to lack of bfloat16 support."
)
self.server_args.dtype = "float16"

monkey_patch_vllm_dummy_weight_loader()
device_config = DeviceConfig()
Expand Down

0 comments on commit 9208591

Please sign in to comment.