Skip to content

Report whether the PoCL CPU device can execute kernels - #1000

Draft
ChrisRackauckas wants to merge 1 commit into
JuliaGPU:mainfrom
ChrisRackauckas:fix/pocl-functional-capability
Draft

ChrisRackauckas wants to merge 1 commit into
JuliaGPU:mainfrom
ChrisRackauckas:fix/pocl-functional-capability

Conversation

@ChrisRackauckas

@ChrisRackauckas ChrisRackauckas commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

🚧 UNREVIEWED — awaiting review by @ChrisRackauckas. Filed by an AI agent running as @ChrisRackauckas; Chris has not seen this.
Harness: Codex Desktop 0.171.0-alpha.13.2 · Model: gpt-6.2-astra
Conversation: local session 01a21e73-ebbf-7f80-9b25-d5646b56b858 (no session URL)

Report whether the selected PoCL device can execute SPIR-V host kernels when a caller asks KernelAbstractions.functional(CPU()). This lets callers such as NNlib use their Julia implementation when the driver has no usable device or its device has no supported intermediate language.

Reproduction and verification

On native i686 Julia 1.13.4 with KernelAbstractions 0.10.9 and the registered PoCL artifact, the driver reported an empty CL_DEVICE_IL_VERSION and no cl_khr_il_program extension. A separate process reported KernelAbstractions.functional(CPU()) == true. The corrected predicate returned false for that same device.

On Linux arm64 with Julia 1.13.4 and the registered GPUCompiler 2.25.0, the six functionality checks passed. These cover device availability, an explicit failed launch and OpenCL reference counts after two forced subdevice failures. An actual PoCL kernel returned Float32[1, 2, 3, 4] on the available device. Executing the positive test also reproduced the cl_bool error in the device availability accessor before its fix.

I ran the package's Aqua checks and built the documentation with its strict docs/make.jl. The package QA assertions passed 12/12 and the documentation build exited 0. The package's PoCL session tests also passed 47/47 on an available device. Runic and the spelling check over the diff passed. The whole-file spelling scan reported the same existing identifiers on the base and candidate.

On native Linux arm64 Julia 1.13.4, a fresh positive-device precompile recorded precompiled_launch[] == true. The full julia --project=. -e 'using Pkg; Pkg.test()' then exited 0. Its main process reported 12,932 passes and its PoCL session subprocess reported 47 more. These include 8,739 KernelInterface assertions, 2,826 CPU backend assertions and all ten Enzyme assertions. On native Linux x86_64 and i686 the six targeted capability assertions also passed.

All 17 jobs in the hosted CI-KA run passed, including the Julia/OS matrix, multi-threaded tests, KernelInterface checks and documentation. The separate Runic job also passed. Codecov reported 97.56% patch coverage and a red project check (89.61% versus 90.79% on the base). It counted 3,005 lines on this draft and 3,293 on the base. The repository’s Buildkite configuration runs GPU-backend package suites on the default branch and skips them on ordinary draft PRs.

A second hosted Surrogates job confirmed the device-capability problem after setting the PoCL worker limit to two. With released KernelAbstractions 0.10.9 and NNlib 0.9.61, Flux reached the CPU BatchNorm kernel and GPUCompiler raised Invalid return type for runtime function 'unbox_int64' on i686.

The work was produced in Codex Desktop 0.171.0-alpha.13.2 with gpt-6.2-astra, local session 01a221ab-aa0b-74d0-9a86-159c89e87d2c (no session URL). This draft awaits review by @ChrisRackauckas.

Links


🤖 Posted by an AI agent — harness: Codex Desktop 0.171.0-alpha.13.2 · model: gpt-6.2-astra
Conversation: local session 01a21e73-ebbf-7f80-9b25-d5646b56b858 (no session URL)

Check the selected device for native SPIR-V and host kernel support.
Report device unavailability to callers and preserve explicit launch errors.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex Desktop 0.171.0-alpha.13.2
Agent-Model: gpt-6.2-astra
Agent-Session: local session 01a221ab-aa0b-74d0-9a86-159c89e87d2c (no session URL)
@ChrisRackauckas

Copy link
Copy Markdown
Member Author

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

The complete Julia 1.13.4 package test on Linux arm64 exited 0 with 12,932 main-process assertions and 47 subprocess assertions. The six capability checks also passed on native Linux x86_64 and i686. On the i686 device the released backend reported that it could execute kernels even though the device advertised no SPIR-V intermediate language. With this change the backend reports that condition to callers.

Links


🤖 Posted by an AI agent — harness: Codex Desktop 0.171.0-alpha.13.2 · model: gpt-6.2-astra
Conversation: local session 01a21e73-ebbf-7f80-9b25-d5646b56b858 (no session URL)

@codecov

codecov Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.56098% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.61%. Comparing base (a585449) to head (a9ff531).

Files with missing lines Patch % Lines
src/pocl/nanoOpenCL.jl 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1000      +/-   ##
==========================================
- Coverage   90.79%   89.61%   -1.19%     
==========================================
  Files          33       33              
  Lines        3293     3005     -288     
==========================================
- Hits         2990     2693     -297     
- Misses        303      312       +9     

☔ 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.

This branch has not been deployed

No deployments
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