MCPcopy Create free account
hub / github.com/antirez/ds4 / model_map_span_vec_include_layer

Function model_map_span_vec_include_layer

ds4.c:4189–4227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4187 ds4_layer_weights block;
4188} ds4_dspark_stage_weights;
4189
4190typedef struct {
4191 uint32_t n_stages;
4192 uint32_t block_size;
4193 uint32_t markov_rank;
4194 uint32_t noise_token_id;
4195 uint32_t target_layer_count;
4196 uint32_t target_layers[DS4_DSPARK_MAX_TARGET_LAYERS];
4197 uint32_t present_tensors;
4198 uint32_t missing_tensors;
4199 uint32_t invalid_tensors;
4200 uint32_t metadata_errors;
4201 bool has_block_size;
4202 bool has_markov_rank;
4203 bool has_noise_token_id;
4204 bool has_target_layers;
4205 ds4_dspark_stage_weights stage[DS4_DSPARK_MAX_STAGES];
4206} ds4_dspark_weights;
4207
4208/* =========================================================================
4209 * Fixed Weight Binding and Model Validation.
4210 * =========================================================================
4211 *
4212 * The GGUF tensor directory is converted into a DS4-specific pointer table.
4213 * After this section, the rest of the program addresses tensors by semantic
4214 * fields such as layer->attn_q_a or layer->ffn_gate_exps rather than by string
4215 * lookup. Shape validation is intentionally strict.
4216 */
4217
4218static uint32_t required_u32(const ds4_model *m, const char *key) {
4219 uint32_t v = 0;
4220 if (!model_get_u32(m, key, &v)) {
4221 fprintf(stderr, "ds4: required metadata key is missing: %s\n", key);
4222 exit(1);
4223 }
4224 return v;
4225}
4226
4227static uint64_t required_u64_compat(const ds4_model *m, const char *key) {
4228 uint64_t v = 0;
4229 if (!model_get_u64_compat(m, key, &v)) {
4230 fprintf(stderr, "ds4: required metadata key is missing: %s\n", key);

Callers 1

weights_model_map_spansFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected