|
7 | 7 | from lightx2v.utils.registry_factory import ATTN_WEIGHT_REGISTER, LN_WEIGHT_REGISTER, MM_WEIGHT_REGISTER, RMS_WEIGHT_REGISTER, ROPE_REGISTER |
8 | 8 |
|
9 | 9 |
|
10 | | -def validate_flux2_block_slab_config(config, ai_device): |
11 | | - """Validate the deliberately narrow first rollout of block slabs.""" |
12 | | - if not config.get("offload_use_block_slab", False): |
13 | | - return False |
14 | | - |
15 | | - requirements = [] |
16 | | - if ai_device != "npu": |
17 | | - requirements.append("AI_DEVICE='npu'") |
18 | | - if not config.get("cpu_offload", False) or config.get("offload_granularity", "block") != "block": |
19 | | - requirements.append("block-level cpu_offload") |
20 | | - if not config.get("use_event_offload", False): |
21 | | - requirements.append("use_event_offload=true") |
22 | | - if config.get("dit_quantized", False) or config.get("dit_quant_scheme", "Default") != "Default": |
23 | | - requirements.append("unquantized dit_quant_scheme='Default'") |
24 | | - if config.get("lora_configs") or config.get("lora_dynamic_apply", False): |
25 | | - requirements.append("LoRA disabled") |
26 | | - if config.get("lazy_load", False): |
27 | | - requirements.append("lazy_load=false") |
28 | | - if config.get("tensor_parallel", False): |
29 | | - requirements.append("tensor_parallel=false") |
30 | | - |
31 | | - if requirements: |
32 | | - raise ValueError("offload_use_block_slab currently requires " + ", ".join(requirements)) |
33 | | - return True |
34 | | - |
35 | | - |
36 | 10 | def _resolve_resident_block_indices(value, num_blocks, policy, config_key): |
37 | 11 | """Resolve a resident-block count into deterministic block indices. |
38 | 12 |
|
|
0 commit comments