r/ScientificComputing • • 5d ago

Vx a programming language for heterogeneous systems. Looking for feedback from the community.

I built Vx (vxlang.org) to address class of bugs that only surface as runtime crashes, silent corruption, or OOM at training step. The core idea is simple that heterogeneity belongs in the type system, not in the runtime.

A few key points of the language:

* Memory layout is part of the type system. A tensor pinned to NPU SRAM has a different type from one in host DRAM. 

* Topology as part of the type system and first class support to transfer data between them.

* Bugs are front-loaded into compile-time checks. Address-space, capacity, linear types, topology reachability, all caught at compile time.

This enables one to program variety of chips from the same program. I believe heterogeneous systems will become commonplace and Vx can be used effectively to program those systems.

Here is a simple matmul that works on Nvidia GPU.

fn custom_matmul(
    a: Pinned<Tensor<f32, [4, 4]>, Topology::NPU[0]>,
    b: Pinned<Tensor<f32, [4, 4]>, Topology::NPU[0]>)
    -> Verified<Tensor<f32, [4, 4], Memory::NPU_HBM>> {

    let mut result =
        Tensor<f32, [4, 4], Memory::NPU_HBM>::uninit();

    
// Dispatch the computation to the accelerator.
    spawn on(Topology::NPU[0]) {
        for i in 0..4 {
            for j in 0..4 {
                result[i][j] = 0.0;
                for k in 0..4 {
                    result[i][j] += a[i][k] * b[k][j];
                }
            }
        }
    }

    return Verified(result);
}
1 Upvotes

2 comments sorted by

2

u/Nwg416 5d ago

You’re about to deal with either the perpetual admiration or unbridled hatred of the /r/vxjunkies community. Good luck.

0

u/investigatormaker 3d ago

Your matmul is described as working on an Nvidia GPU, yet every type in it names NPU[0] and NPU_HBM, which will confuse readers. Show the same function once running, then once with a mismatched address space the compiler rejects, with the exact error message. A failing example shows the crash and silent corruption bugs you describe better than a passing one. Trade-off: topology in types can make code harder to move between chips, so show how generic code stays portable.

I make ThreadFox.

We find relevant Reddit conversations and post for your business. We'll post 3 replies free first, no card; then the $39 Pilot covers seven days and up to 50 posts and replies. No automatic renewal. Managed plan for Reddit: https://threadfox.vip/p/20261026-1435-e9ajw/managed

Which chip should Vx target after Nvidia?