Overview
This article provides a solution for slow model loading performance when using older versions of the SGLang framework on Crusoe Cloud, particularly on MI300x nodes with Shared Disks. Customers may experience read throughput far below the documented performance of the storage, with large models taking an unexpectedly long time to load.
Prerequisites
- Access to a Crusoe Cloud project with a provisioned Crusoe Managed Kubernetes (CMK) cluster.
- A running VM or pod with access to the
dockeror container runtime. - Model weights (e.g., Deepseek-V3) stored on a Crusoe Shared Disk, accessible from the CMK cluster.
Steps
-
Step 1: Update Your Container Image
- The multi-threaded loading feature is available in a newer version of the
sglangcontainer. Update your Kubernetes deployment YAML or container run command to use the following image or a later version: lmsysorg/sglang:v0.4.10.post2-rocm630-mi30x
- The multi-threaded loading feature is available in a newer version of the
-
Step 2: Modify the SGLang Launch Command
- To activate the new feature, you must add the
--model-loader-extra-configflag to yoursglang.launch_servercommand. This flag takes a JSON string that enables multi-threading and specifies the number of threads to use. A good starting point is to match the number of threads to the tensor parallelism (--tp) degree.
- To activate the new feature, you must add the
Example Command:
python3 -m sglang.launch_server \
--model deepseek-ai/DeepSeek-V3 \
--port 30000 \
--tp 8 \
--trust-remote-code \
--enable-metrics \
--model-loader-extra-config "{\"enable_multithread_load\": true, \"num_threads\": 8}"Resolution
Applying this solution has been shown to resolve critical performance issues for this workload. In a benchmark scenario, the following improvements were observed:
-
Before: Using older
sglangversions resulted in slow, single-threaded I/O, causing a significant performance bottleneck when loading large models from a Shared Disk. - After: Upgrading the container and enabling the multi-threaded loader allows the application to perform parallel reads, resolving the performance bottleneck and leading to significantly improved model loading times.
Enabling multi-threaded loading allows sglang to fully utilize the available storage bandwidth, leading to drastically faster model load times.
Additional Resources
- Crusoe Docs: Managing Shared Disks
- SGLang Project: SGLang GitHub Repository