← Back to events
ActiveAIRelease

trunk/33b24bf2185ee276aadeb1a6e90ad6a9d07b6ca5: Check num_heads in F::multi_head_attention_forward (#195381)

What happened

Fixes #106700 . torch::nn::functional::multi_head_attention_forward divides before it validates: const auto head_dim = embed_dim / num_heads; TORCH_CHECK (head_dim * num_heads == embed_dim, " embed_dim must be divisible by num_heads " ); so num_heads == 0 is an integer division by zero. That is not a catchable exception — the process dies. Running the call in a subprocess on Windows exits with 0xC0000094 ( STATUS_IN…

Summary assembled by rule from the sources below

Why it's spreading

Sources