Skip to content

Apply β in generic_matmatmul!/generic_matvecmul! when the inner dimension is empty. - #628

Merged
maleadt merged 1 commit into
mainfrom
tb/empty_matmul
Aug 27, 2026
Merged

Apply β in generic_matmatmul!/generic_matvecmul! when the inner dimension is empty.#628
maleadt merged 1 commit into
mainfrom
tb/empty_matmul

Conversation

@maleadt

@maleadt maleadt commented Aug 27, 2026

Copy link
Copy Markdown
Member

The empty-operand shortcuts unconditionally zeroed the output, but for K == 0 the result is β*C (as LinearAlgebra's _rmul_or_fill! does).

Also clamp the preliminary workgroup size in launch_config to at least 1, so launching a kernel over an empty ndrange (e.g. rmul! on a 0×N array) takes the groups == 0 early return instead of throwing a DivideError.

Uncovered by the K == 0 tests added in JuliaGPU/GPUArrays.jl#773.

…sion is empty

The empty-operand shortcuts unconditionally zeroed the output, but for
K == 0 the result is β*C (as LinearAlgebra's _rmul_or_fill! does).

Also clamp the preliminary workgroup size in launch_config to at least 1,
so launching a kernel over an empty ndrange (e.g. rmul! on a 0×N array)
takes the groups == 0 early return instead of throwing a DivideError.

Uncovered by the K == 0 tests added in JuliaGPU/GPUArrays.jl#773.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.19%. Comparing base (8396b5f) to head (53c0596).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/mkl/linalg.jl 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #628      +/-   ##
==========================================
+ Coverage   79.52%   81.19%   +1.66%     
==========================================
  Files          50       50              
  Lines        3571     3568       -3     
==========================================
+ Hits         2840     2897      +57     
+ Misses        731      671      -60     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt
maleadt merged commit db8bc78 into main Aug 27, 2026
5 checks passed
@maleadt
maleadt deleted the tb/empty_matmul branch August 27, 2026 07:42
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.

1 participant