[fix]load hadamard_block_size from config #3797
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR modifies the hadamard_block_size to be loaded from config.json.
Example:
{ "architectures": [ "Ernie4_5_MoeForCausalLM" ], "bos_token_id": 1, "eos_token_id": 2, "dtype": "bfloat16", "hidden_act": "silu", "hidden_size": 8192, "intermediate_size": 28672, "max_position_embeddings": 131072, "model_type": "ernie4_5_moe", "num_attention_heads": 64, "num_key_value_heads": 8, "num_hidden_layers": 54, "pad_token_id": 0, "rms_norm_eps": 1e-05, "use_cache": false, "vocab_size": 103424, "rope_theta": 500000, "use_rmsnorm": true, "use_bias": false, "moe_num_experts": 64, "moe_layer_start_index": 3, "moe_intermediate_size": 3584, "moe_capacity": [64,64,64], "moe_gate": "topk", "moe_k": 8, "moe_layer_interval": 1, "moe_use_aux_free": true, "num_nextn_predict_layers": 1, "tie_word_embeddings": false, "is_quantized": true, "quantization_config":{ "dense_quant_type":"block_wise_fp8", "moe_quant_type":"w4a8", "quantization":"mix_quant", "is_permuted": true, "hadamard_block_size": 512 } }