Skip to content

Rework Codelet to be more similar to C++ API #9

@vchuravy

Description

@vchuravy
struct MyVertex <: Vertex
  in::PopVec
  out::PopVec
end
function (vertex::MyVertex)()
   vertex.out .= vertex.in
end

According the the docs the ABI is:

int __runCodelet_MyVertex() {

  void *vertexPtr = __builtin_colossus_get_vertex_base();
  auto v = static_cast<MyVertex*>(vertexPtr);
  return v->compute();
}

We could codegen that __runCodlet function.
@llvm.colossus.get.vertex.base() is the intrinsic to get the vector base.

The big unknown is how to do the mapping from Julia fields to input and output in the poplar graph.

There is an inspector https://docs.graphcore.ai/projects/poplar-api/en/latest/poplar/graph/VertexIntrospector.html#_CPPv4N6poplar18VertexIntrospectorE

So the question is how popc generates the mapping

Metadata

Metadata

Assignees

No one assigned

    Labels

    code generationRelated to GPUCompiler code generation infrastructureenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions