@@ -205,34 +205,87 @@ The following legacy options and environment variables were removed and must no
205205
206206### FastSafeTensors loader configuration
207207
208- When ` LOAD_METHOD=fastsafetensors ` , RTP-LLM uses the config-driven ` AutoLoader ` .
208+ When ` LOAD_METHOD=fastsafetensors ` , or when the default ` auto ` mode selects the
209+ FastSafeTensors path, RTP-LLM uses the config-driven ` AutoLoader ` . RTP checks
210+ the installed package capabilities before loading: the full capability set uses
211+ bounded ` per-expert ` delivery, a package without ` dim0_split_templates ` falls
212+ back to the higher-memory ` full-stacked ` compatibility path, and a package
213+ without ` local_copyout_filter ` continues with full materialization and RTP
214+ consumer-side filtering. A missing package/` AutoLoader ` , an import/ABI failure,
215+ an unmet AUTO prerequisite, or an insufficient memory preflight falls back to
216+ ` scratch ` . These compatibility paths apply to both ` auto ` and an explicit
217+ ` LOAD_METHOD=fastsafetensors ` , so package age alone does not fail model startup.
218+ The two optional keywords control independent optimizations:
219+
220+ | Capability | Present | Missing |
221+ | ---| ---| ---|
222+ | ` local_copyout_filter ` | rank-local copy-out | full materialization, RTP consumer filtering |
223+ | ` dim0_split_templates ` | bounded ` per-expert ` MoE delivery | ` full-stacked ` MoE delivery |
224+
225+ When a degraded FastSafeTensors mode remains usable, RTP logs
226+ ` requested_mode ` , ` effective_mode ` and ` degraded_reason ` . A scratch fallback
227+ contains ` falls back to scratch ` ; package absence is INFO and other fallback
228+ causes are WARNING. CI or image builds that require both optimizations must
229+ install the matching wheel and treat a missing capability as a packaging
230+ failure. Set ` RTP_LLM_EXPECT_FASTSAFETENSORS_TIER=per-expert ` for the installed
231+ wheel contract test to turn a lower tier into a test failure; supported tiers
232+ are ` scratch ` , ` consumer-filter ` , ` full-stacked ` , and ` per-expert ` .
233+
209234Pass the standard fastsafetensors configuration as either an inline JSON string
210- or a JSON file path. Inline JSON has higher priority when both are set:
235+ or a JSON file path. The installed FastSafeTensors version defines the precise
236+ configuration defaults and precedence:
211237
212238``` bash
213- # Inline JSON string
214- export FASTSAFETENSORS_CONFIG_JSON=' {"loader":"base","base":{"copier_type":"nogds"}}'
239+ # Inline JSON string; progress is controlled by the upstream parallel config.
240+ export FASTSAFETENSORS_CONFIG_JSON=' {"loader":"base","base":{"copier_type":"nogds"},"parallel":{"use_tqdm_on_load":true} }'
215241
216242# JSON file path; the file contains the same JSON object
217243export FASTSAFETENSORS_CONFIG=/path/to/fastsafetensors.json
218244```
219245
246+ The same configuration also affects ` auto ` selection. RTP reads
247+ ` estimated_peak_device_bytes ` from the installed package; missing or invalid
248+ values use the historical ` 3 × max checkpoint shard ` estimate. Larger buffers,
249+ queues or producer counts can raise ` transient_mem ` enough for ` auto ` to choose
250+ ` scratch ` . Inspect the ` fastsafetensor memory check ` log and its ` enough ` field.
251+
220252For compatibility with existing development environments,
221- ` FASTSAFETENSORS_NOGDS=1 ` remains supported. Before constructing ` AutoLoader ` ,
222- RTP-LLM directly overrides ` FASTSAFETENSORS_CONFIG_JSON ` with
253+ ` FASTSAFETENSORS_NOGDS=1 ` remains supported. Before memory preflight or
254+ constructing ` AutoLoader ` , RTP-LLM overrides ` FASTSAFETENSORS_CONFIG_JSON `
255+ process-wide with
223256` {"loader":"base","base":{"copier_type":"nogds"}} ` . This compatibility switch
224- therefore takes priority over other fastsafetensors configuration. Prefer one
225- of the standard configuration variables above for new deployments.
257+ therefore remains in effect for subsequent loaders in the same process. Prefer
258+ one of the standard configuration variables above for new deployments. When
259+ ` FASTSAFETENSORS_CONFIG ` is also set, the final precedence remains an upstream
260+ package contract; current pinned wheels prefer the inline JSON value.
226261
227262Stacked MoE checkpoints use bounded-memory per-expert delivery by default: the
228263source rank slices the stacked tensor first, then every rank broadcasts one
229- expert at a time. The higher-memory full-stacked path is retained only for
230- controlled performance comparisons:
264+ expert at a time. The higher-memory full-stacked path is a temporary
265+ compatibility rollback for wheels or deployments that cannot use the bounded
266+ split path, and it may also be used for controlled performance comparisons:
231267
232268``` bash
233269export RTP_FASTSAFETENSORS_STACKED_MOE_MODE=full-stacked
234270```
235271
236- The accepted values are ` per-expert ` (default) and ` full-stacked ` . This RTP
237- switch only selects how stacked MoE tensors are delivered; ordinary tensors
238- continue to use the FastSafeTensors bucket and rank-local-copy settings.
272+ The accepted values are ` per-expert ` (default) and ` full-stacked ` ; an empty
273+ value also selects the default. ` full-stacked ` adds a conservative extra shard
274+ to the FastSafeTensors memory preflight because it materializes a whole stacked
275+ tensor before RTP clones expert slices. A passive downgrade logs a warning with
276+ ` degraded_reason ` ; an explicit request is reported as the selected mode. The
277+ additional warning is emitted only when the checkpoint actually contains raw
278+ stacked MoE tensors. Use ` LOAD_METHOD=scratch ` as the more conservative
279+ rollback. This transitional RTP switch only selects stacked MoE delivery.
280+ Bucket size, copier/backend, queue depth, producer count, loading progress and
281+ tensor ordering are otherwise owned by the installed FastSafeTensors
282+ configuration; rank-local copy-out is supplied by RTP's local checkpoint-key
283+ predicate.
284+
285+ ` RTP_FASTSAFETENSORS_STACKED_MOE_MODE ` is a transitional, environment-only
286+ switch: it has no command-line flag, is not shown by ` --help ` , and is not part
287+ of the startup config dump. It is read only when the FastSafeTensors path is
288+ considered. Values are case-sensitive and use a hyphen; any non-empty value
289+ other than ` per-expert ` or ` full-stacked ` raises ` ValueError ` during
290+ FastSafeTensors selection. It has no effect for ` LOAD_METHOD=scratch ` or for
291+ weights that cannot use the FastSafeTensors path.
0 commit comments