Skip to content

Add ET vision kernels for SmolVLM2#10

Closed
AFOliveira wants to merge 127 commits into
aifoundry-org:etfrom
AFOliveira:agent/smolvlm2-vision-et
Closed

Add ET vision kernels for SmolVLM2#10
AFOliveira wants to merge 127 commits into
aifoundry-org:etfrom
AFOliveira:agent/smolvlm2-vision-et

Conversation

@AFOliveira

Copy link
Copy Markdown
Member

Summary

Add ET backend coverage for the three operations required to keep the
SmolVLM2/SigLIP vision graph entirely on ET-SoC1:

  • F32 2D IM2COL for patch embeddings
  • F32 LayerNorm (NORM)
  • contiguous F32 approximate GELU (UNARY)

The backend advertises only the supported type, layout, alignment, and unary
variant combinations. Each operation is implemented as an embedded ET device
kernel and dispatched by the existing graph executor.

Validation

  • ET cross-compile and unimplemented-instruction checks pass for all kernels.
  • test-backend-ops test -b ET -o NORM,UNARY,IM2COL: 54/54 supported LayerNorm/IM2COL cases pass.
  • test-backend-ops test -b ET -o GELU: supported F32 GELU case passes.
  • SmolVLM2-500M four-case CPU/ET image benchmark passes with identical answers.
  • CLIP reports the ET backend with no unsupported operations or CPU fallback list.
  • All 33 language-model layers remain offloaded to ET.

The end-to-end six-frame benchmark improved from a 4.7837 to 4.6711 real-time
factor while removing all vision CPU fallbacks.

glguida and others added 30 commits October 19, 2025 10:02
This commit adds a stub implementation of the ET backend.

Doesn't do anything beside creating the infrastructure that can
be later expanded to effectively implement a backend.

It builds, registers the backend and finds no devices at
initialisation time.
Device with offboard memory is considered GPU.
ACCEL type is for accelerators like Blas.
This change initializes the runtime, and in the process fixes the
initialization of the backend in general.

Currently only supported operation is listing of devices.
GUID is a required property and is checked very early during
initialization.
Buffer usage is decided during model loading, before any interrogation
for ops support. Even if ops are not supported it should be possible
to allocate/set_tensor/get_tensor on device buffers.

Until we implement device buffer management we need to declare host
buffer support, so that fallback to CPU backend works correctly.
The integer device used by ggml for device id is now called devidx.

This will help separate it more clearly from the _runtime_ id.
For now, we can't get the amount of free memory. This will be
fixed in the future through modifications to runtime.

We use free == total, _for_ _now_.
This will help us, in the future, to create a better description
thanks to the runtime device properties.
This will be very useful in future calls to the runtime, to identify
our device.
Allocate reg before initialising devices so that the 'reg' pointer
is valid.
- Allocate/free memory on device
- Implement host-to-device and device-to-host memory transfers
ggml checks existence of these functions and calls then instead
of synchronous ones thus braking inference (specifically
it needs to transfer logits from device to host for sampling).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants