Skip to content

Platform Support

A reference that gathers, on one page, “how far each target has been verified” for the targets generated by griffith deploy codegen-c / codegen-cuda / codegen-metal / codegen-web. For how to use the deploy kit as a whole, see the Deploy Kit Quickstart, and for the bundle format see the Deploy bundle spec.

The “verification” columns on this page use three levels. They exist so that we never write “it works” for something we have not verified.

LevelMeaning
Measured and verifiedBuilt and run on real hardware, with integer-exact agreement with ir/simulate.py (the golden model) confirmed by a test or a verify command
Build confirmed onlyCross-compilation is confirmed to succeed, but nothing was run in that environment (integer agreement is unverified)
Theoretically possible by standards conformance (unverified)The code handles it through branches or macros, but there is no build or run record
CompilerVerification levelBasis
clang (environments where cc resolves to clang; macOS by default)Measured and verifiedHost runs and benchmark measurements, plus cross-compilation (table below)
gcc (environments where cc / gcc resolves to gcc)Build confirmed onlyConfirmed that a host build with -Wall -Wextra -Werror succeeds (reconfirmed on Linux with gcc 9.4.0). Cross targets (-target <triple>) are out of scope because that is clang-only syntax
clang (cross for Windows: x86_64-pc-windows-msvc / x86_64-w64-windows-gnu)Build confirmed onlyConfirmed down to object generation from Apple clang with -ffreestanding -DMDL_NO_LIBC. Running under a real cl.exe / MinGW is unverified
MSVC (real cl.exe) / real MinGW gccTheoretically possible by standards conformance (unverified)mdl_simd.h only has an SSE2 detection branch for the MSVC dialect (_M_IX86_FP). There is no build or run record on real machines

The C runtime’s dependencies are just two C99 standard headers (<stdint.h> / <stddef.h>), and the only libc functions are memcpy / memset (-DMDL_NO_LIBC switches to our own implementations, so libc is not needed at all).

The range of compilers available for verification is also limited. The clang at hand (Apple clang 21.0.0) has cross backends only for the ARM / AArch64 family and the x86 family, with no backend for RISC-V / MIPS / WASM / Xtensa / MSP430. These are “unverified” not because of any constraint in the code but because there was no verification environment.

EnvironmentVerification levelBasis
macOS (Apple Silicon)Measured and verifiedHost runs and benchmark measurements on an Apple M3. Also the verification environment for the Metal and Web runtimes
Linux (x86_64 / i386, native execution)Measured and verifiedCross-compiled, run, and confirmed down to numeric agreement
Bare metal (Cortex-M0 / M0+ / M3 / M4 / M4F / M7 / M33, Cortex-A family, -ffreestanding -DMDL_NO_LIBC)Build confirmed onlyCross-compilation passes only (nothing run on hardware)
Windows (core inference only: mdl_kernels.c + the generated model)Build confirmed onlyDown to object generation via the clang cross above. The parallel helper mdl_threads.c is pthread-only and not supported on Windows
Browser (Chromium, WASM)Measured and verifiedgriffith deploy verify-web. The only verified browser is Chromium. This is the TS / AssemblyScript Web runtime, a different thing from the C runtime’s freestanding WASM build
ESP32 (Xtensa, ESP-IDF)Measured and verified (activity-recognition dense). The 128px convolutional face detector does not fit (DRAM overflow)Run on a real ESP32-D0WDQ6 (240 MHz, 4MB flash, no PSRAM) with ESP-IDF v5.4-dev. All 50 samples of activity recognition k600 / k2400 / k6000 and MNIST matched as integers (default compression = lut_flat: k600 290.7 µs, k2400 782.2 µs, k6000 12.69 ms, MNIST 324.7 µs; uncompressed: k600 410.9 µs, k6000 26.60 ms). The output still matches the uncompressed one as integers. Face detection overflows dram0_0_seg by 1,394,696 B
iOS simulator (iPhone 17, iOS 26.5)Measured and verifiedOutput matched as integers on five models (XOR, two activity-recognition models, face detection, MNIST). Times are host CPU (Apple Silicon) values, not real-device values
iOS device (iPhone 17, iOS 26.6.2)Integer match confirmed on a real deviceThe outputs of five models (XOR, activity recognition k600 / k6000, MNIST, face detection) matched ir/simulate.py as integers (Release). Medians: activity recognition k6000 (lut_flat, 15,124 gates) 8.07 µs, face detection (1,279 gates, 8 synthetic images) 0.803 ms. One measurement per model. An unsigned Release build (generic/platform=iOS) also succeeds
AndroidTheoretically possible by standards conformance (unverified)Intended to be embedded via the NDK, but there is no real-device build or run record yet

Supported CPU architectures: the portability contract

Section titled “Supported CPU architectures: the portability contract”

The conclusion first. Any target that has a C99 (cross) compiler should work, in principle. The “supported architectures” are not a list of separate implementations prepared per instruction set; they are merely a list of the verification record of whether the same single C99 source goes through as is. The grounds are as follows.

  • The core is strict C99. The only headers it depends on are <stdint.h> / <stddef.h>, both of which the C standard obliges even freestanding implementations to provide. -DMDL_NO_LIBC also removes the need for libc (it builds without host headers under -ffreestanding)
  • Architecture-specific code (NEON / SSE2 / AVX2 intrinsics and detection macros) is isolated in the single file mdl_simd.h. On unsupported architectures, or with -DMDL_NO_SIMD, it automatically falls back to a bit-identical scalar implementation
  • No endianness or alignment assumptions are introduced. Bit-plane word operations are all defined by bit position (x>>5, x&31), and the core contains not a single pointer cast that reinterprets a byte sequence in memory as another integer width
  • SIMD only makes it faster and does not affect correctness. That the SIMD path and a scalar-forced build agree bit for bit on real models is pinned by a test
  • It is pinned likewise that the generated code (model.c / model.h) contains no architecture-specific code

The contract is enforced mechanically by the following checks.

What is checkedCorresponding test
Architecture detection macros and inline asm do not exist outside mdl_simd.hTestSIMDContract
The core has no byte-reinterpreting castsTestSIMDContract
The SIMD path and the scalar path agree bit for bit on real modelsTestSIMDContract
The generated code also has no architecture-specific codeTestSIMDContract
Only two dependency headersTestFreestanding
No heap allocation, floating point, or I/OTestFreestanding
A libc-free build (-DMDL_NO_LIBC -ffreestanding) goes throughTestFreestanding

The tests are in tests/deploy/test_c_portability.py.

Of the range that “should in principle work” under the contract, this groups what was actually confirmed down to a build or a run by use case. The source of truth is CROSS_TARGETS in the same test, and backends the clang at hand does not have are skipped automatically.

Use-case groupVerification levelTarget triples includedRepresentative devices
Embedded ARM (Cortex-M family / Cortex-A family)Build confirmed onlythumbv6m-none-eabi, armv7m-none-eabi, armv7a-none-eabi, thumbv7em-none-eabi, armv8m.main-none-eabi, aarch64-none-elf, aarch64_be-none-elf (big-endian)Cortex-M0 / M0+ / M3 / M4 / M4F / M7 / M33 (STM32 and others), Cortex-A family
Linux x86 (i386 / x86_64)Run and confirmed down to numeric agreementi386-unknown-linux-gnu, x86_64-unknown-linux-gnuPCs / servers
aarch64 host nativeRun and confirmed down to numeric agreement (including NEON versus scalar agreement)(host aarch64)Apple Silicon (measured on M3); iPhone / Android / Raspberry Pi are the same architecture
Windows (core inference only)Build confirmed only (cross, -ffreestanding -DMDL_NO_LIBC)x86_64-pc-windows-msvc, x86_64-w64-windows-gnuWindows (MSVC / MinGW ABI). Running on real machines is unverified
RISC-V / MIPS / WASM (C version)Unverified because no verification environment exists (expected to work under the contract)riscv32-unknown-elf, riscv64-unknown-elf, riscv64-unknown-linux-gnu, mipsel-unknown-linux-gnu, wasm32-unknown-unknownRISC-V embedded / Linux, MIPS Linux, freestanding WASM
Xtensa (ESP32)Run, integer agreement confirmed (activity-recognition dense; the 128px convolutional model does not fit, DRAM overflow)(xtensa-esp-elf 13.2.0 bundled with ESP-IDF v5.4-dev)ESP32-D0WDQ6 (no PSRAM). PSRAM boards are unverified

About the Windows parallel helper: mdl_threads.c (mdl_run_pool and others) is pthread-only and not supported on Windows. The core (mdl_kernels.c + the generated model) cross-builds on Windows too, but to use multiple cores you call mdl_infer_ctx (re-entrant when the contexts differ) directly from the caller’s own threads (CreateThread and the like).

The SIMD path is selected automatically by macros at compile time, and falls back to scalar where disabled (mdl_simd.h). The integer output is exactly identical on every path, which is pinned by a test as part of the portability contract above.

PathDetection macroVerification levelBasis
NEON__ARM_NEON / __ARM_NEON__Measured and verifiedRun on an Apple M3. Integer-output agreement with the scalar path is pinned by a test (this Mac’s default build is NEON)
SSE2__SSE2__, or _M_IX86_FP >= 2 (MSVC dialect)Build confirmed onlyThe x86_64 cross-compile goes through, but there is no record of running the SSE2 path itself on real hardware
Scalar (fallback)When neither of the above is present, or -DMDL_NO_SIMDMeasured and verifiedThe baseline path for all measurements. Also the comparison target for the SIMD path
AVX2__AVX2__ (MSVC unsupported)Measured and verifiedReal Xeon W-1270P (Comet Lake, 8C16T), gcc 9.4.0. For dense and conv models alike, the AVX2 build and the scalar / SSE2 builds produce byte-identical output. This verification is a manual A/B and is not a standing test. You can go back to SSE2 with -DMDL_NO_AVX2 / -mno-avx2
AVX-512—Not implementedThe verification machine has no AVX-512 and cannot run it, so implementation was put off

What is unsupported compared with similar libraries

Section titled “What is unsupported compared with similar libraries”

An honest inventory of what runtimes in the class of ONNX Runtime / TFLite / llama.cpp usually have, but this one does not at present. “Unsupported” is not “impossible” (we write only standard C99, so if a verification environment is available the build will likely go through).

ItemStatusReason
Run verification on RISC-V / MIPS hardware (or QEMU)UnsupportedNo cross toolchain at hand. Running also needs an emulator or real hardware
Build and run on real Windows (cl.exe / MinGW)UnsupportedConfirmed down to object generation via clang cross, but no Windows machine is at hand
Real Android device (via the NDK)UnsupportedAn embedding procedure is envisioned, but there is no real-device or NDK build record
A convolutional model (128px face detection) on ESP32Not supported yetOn a plain ESP32 without PSRAM, MDL_CTX_BYTES of 1,544,000 B does not fit in static DRAM (180,736 B). PSRAM boards are unverified (Run on ESP32)
MSP430UnsupportedNeeds TI’s toolchain
WASM (C version, freestanding build for wasm32-unknown-unknown)Unsupportedemcc / wasi-sdk are not at hand. WASM for browsers is already measured and verified, but that is a different source from the C runtime
Prebuilt binaries distributed via npm / pipUnsupportedThis repository is source-only distribution (also by design: distributables are not split per instruction set)
ItemContentsVerification level
Verified GPURTX 4070 Ti (compute capability 8.9 = sm_89)Measured and verified
Verified CUDA versionCUDA 12.8Measured and verified
Example build commandnvcc -O2 -arch=sm_89 -I. model_cuda.cu mdl_cuda.cu your_main.cu -o app—
Other compute capabilities / CUDA versionsNo minimum-requirement check in the code; it goes through if nvcc can interpret itTheoretically possible by standards conformance (unverified)
Verify commandcodegen-cuda only generates code; there is no subcommand equivalent to verify-cuda—
Flattened netlist lut_flat (--dense-flat auto / on)Can be generated, but has not been run on real NVIDIA hardware (only a syntax check of the generated code; on Metal, integer agreement was confirmed on real hardware)Unverified

CUDA kernels’ formulas are shared with Metal (the __device__ / device difference is absorbed by a macro), and integer agreement with the C version is pinned by a test.

ItemContentsVerification level
Verified environmentApple M3, macOS 26 seriesMeasured and verified
Toolchain requirementsclang++ and Metal.framework are enough (detected by being on macOS, clang++, and the existence of the runtime directory)Measured and verified
Xcode’s metal toolchainNot needed. Shaders are compiled from source at run time, so precompiling a .metallib is just an optional optimization (shorter cold start)Measured and verified (run-time compile path)
Other Apple silicon (M1 / M2 / M4 and so on)Expected to work since it is the same Metal APITheoretically possible by standards conformance (unverified)

The verify command is griffith deploy verify-metal (needs macOS + an Apple GPU + clang++).

ItemContentsVerification level
Verified browserChromiumMeasured and verified (griffith deploy verify-web)
wasm-SIMD (release-simd.wasm)The engine preferred by default. Where unsupported, it records the reason and automatically falls back to pure TS (js)Measured and verified (output agreement of both engines, including the fallback, is pinned by a test)
Firefox / Safari aloneNo individual measurement recordTheoretically possible by standards conformance (unverified)
Serving requirementsthreads=1 is the default, so no SharedArrayBuffer is needed. Plain static serving without COOP/COEP headers worksMeasured and verified

Output to Verilog / VHDL is a separate path from the deploy kit’s C / GPU / Web (griffith export-hdl), but it starts from the same IR. It is verified by three-way equivalence (PyTorch hard eval, ir/simulate.py, HDL simulation).

ItemContentsVerification level
VerilogChecks the generated output with iverilog (can run locally)Measured and verified
VHDLChecks the generated output with ghdl (ghdl is officially verified in CI / cloud containers)Measured and verified
Real FPGATang Nano 20K / DE0-CV and othersSee the supported-boards table in Deploy to FPGA

The procedure and the details of the check are in HDL Export.

Supported node kinds and unsupported features

Section titled “Supported node kinds and unsupported features”

The IR node kinds the C runtime supports are conv2d / or_pool2d / upsample2d / permute / concat / group_sum / lut_layer (n_inputs<=5) / flatten. Shapes outside the range raise at generation time (UnsupportedNode), and nothing silently falls back to another path (so that unverified code is not shipped).

NodeSupported range
conv2dGeneral (any stride / padding; stride=1 with equal width takes the shared-shift-plane fast path)
or_pool2dkernel=2, stride=2, padding=0 only
upsample2dscale=2 (nearest neighbor) only
permuteChannel axis only / the SpatialGroupSum form ([0,2,3,1] + group_sum fusion)
concatChannel axis (bit planes) / score vectors (a detection model’s multi-head output)
group_sumPlain sum / SpatialGroupSum fusion
lut_layern_inputs <= 5
lut_flatThe flat dense netlist. griffith deploy codegen-c builds it at C-generation time with the default --dense-flat auto when the effective-gate reduction is at or above the threshold (bundle --dense-flat can also bake it into the bundle). Now it also runs on the Web (codegen-web flattens by default) and on CUDA / Metal (executing level by level in parallel; codegen-cuda / codegen-metal default to off, opt in with --dense-flat auto / on). It does not appear with --dense-flat off
flattenPass-through

The unsupported features that deserve particular attention are as follows.

  • Box decoding for detection models (CenterNet peak extraction plus NMS) is not included. What the runtime returns is up to the score map, and everything after that is post-processing on the application side (see Prepare demo models for the procedure)
  • add / binarize / constant / generic pool / generic upsample are not implemented (they do not appear in real models)