Skip to content

Qwen3.5#1

Open
13Mico wants to merge 6 commits into
masterfrom
qwen3.5
Open

Qwen3.5#1
13Mico wants to merge 6 commits into
masterfrom
qwen3.5

Conversation

@13Mico

@13Mico 13Mico commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Ajout de l'implémentation du modèle Qwen3.5 pour l'inférence locale. Merci de jeter un coup d'œil avant le merge, notamment aux parseurs (modifications faites avec l'aide de Claude).

@13Mico 13Mico requested a review from Ced July 3, 2026 09:47

@Ced Ced left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Few minor style suff plus two larger comments:

  • please review RoPE mechanism and see whether we can consolidate in a single kernel like the existing mechanism. Note the existing mechanism is pre-computing cos/sin values. Can we do it there?
  • better separate the various kernels (don't fuse them too aggressively) so we can better understand the process and identify kernels that could be replaced by a function call to an optimized implementation

Comment thread include/safetensors.h Outdated
Comment thread include/transformer.h
// Utility variables
float* rope_cos_sin; // [context_len][head_dim]
// linear attention buffers
float* la_conv_state; // [la_layer_count][la_qkv_dim][la_kernel_size-1]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[la_kernel_size-1]

-1?

Comment thread source/transformer.c Outdated
Comment thread source/transformer.c Outdated
Comment thread source/transformer.c
Comment thread source/transformer.c Outdated
Comment thread source/transformer.c
float* x,
size_t head_dim,
size_t n_rot,
const size_t sections[4],

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this "4" guaranteed to be always 4 related to t/h/w/e/ -- btw what do they mean?), or is it another parameter like mrope_section_count?

Comment thread source/transformer.c Outdated
// (void)la_norm_weight;
// (void)la_out_weight;

const bool use_imrope = mrope_section_count > 0 && mrope_section != NULL;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All RoPE management may need another pass: what can be prepared outside the main kernel and can we generalize rope_head_inplace as a single kernel with different parameters?
Worth some additional review.

Comment thread source/transformer.c Outdated
Comment thread source/transformer.c Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants