Skip to content

[Vulkan] Bias-add kernel (bias_add_f32) #7

Closed

Description

@jamesburton

Context

VulkanTransformerModel.AddBiasRows currently host-maps and adds on CPU. SmolLM has no biases; Phi-3 does and triggers the host fallback — trivially slow.

What

Implement a Vulkan pointwise bias_add_f32 kernel and replace the host fallback.

Why this matters

Avoids device→host→device round-trip per decode step for any model that has projection biases (Phi-3 family and others).

Where to start

  • src/DotLLM.Vulkan/VulkanTransformerModel.cs — find AddBiasRows.
  • CUDA reference native/kernels/bias_add_f32.cu.

Acceptance criteria

  • Pointwise kernel with parity test.
  • Host fallback replaced.
  • Phi-3 argmax-parity integration test added.

Activity

  1. jamesburton commented on Jul 5, 2026

    @jamesburton
    OwnerAuthor

    Implemented and merged to dev — native/vulkan/shaders/bias_add_f32.comp exists and is wired (issue #7 referenced directly in its commit history: 416363c "Vulkan: add bias_add_f32 kernel + wire it in (issue #7)").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vulkanVulkan GPU backend

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions