-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework Codelet to be more similar to C++ API #9
Comments
There is a very interest method:
That makes it sound like there is an extended |
So I propose the following experiment:
|
For the record, I applied diff --git a/feature_examples/poplar/advanced_example/Makefile b/feature_examples/poplar/advanced_example/Makefile
index b899c2f..1d59c1b 100644
--- a/feature_examples/poplar/advanced_example/Makefile
+++ b/feature_examples/poplar/advanced_example/Makefile
@@ -1,12 +1,15 @@
CC = g++
-all: codelets.gp example
+all: example
codelets.gp: codelets.cpp
- popc codelets.cpp -o codelets.gp
+ popc $^ -o $@
-example: utils.h main.cpp
- $(CC) --std=c++11 main.cpp -o example -lpoplar -lpopops -lboost_program_options
+codelets.ll: codelets.cpp
+ popc --emit-llvm -target ipu2 $^ -o $@
+
+example: main.cpp utils.h codelets.ll
+ $(CC) --std=c++11 $< -o $@ -lpoplar -lpopops -lboost_program_options
clean:
- rm codelets.gp example
+ rm -f codelets.ll codelets.gp example
diff --git a/feature_examples/poplar/advanced_example/main.cpp b/feature_examples/poplar/advanced_example/main.cpp
index 505fe38..dfe540d 100644
--- a/feature_examples/poplar/advanced_example/main.cpp
+++ b/feature_examples/poplar/advanced_example/main.cpp
@@ -39,7 +39,7 @@ buildGraphAndPrograms(poplar::Graph &g, const utils::Options &options) {
// Before we can add a custom vertex to the graph we need to load its
// code. NOTE: .gp files are precompiled codelets but we could also
// have loaded and compiled source directly here:
- g.addCodelets("codelets.gp"); // g.addCodelets("codelets.cpp");
+ g.addCodelets("codelets.ll"); // g.addCodelets("codelets.cpp");
auto v = g.addVertex(cs1, "VectorAdd");
// Vertices must also be mapped to tiles. This computation will to https://github.com/graphcore/tutorials/tree/b7ffa4de24e07efbeda2e3241ea46d20fa119b84, and ran
in
I was told in Graphcore Slack that this might be bug. Tried with both Poplar SDK v2.5 and v3.0. |
Can you try passing |
I tried that, and it didn't change much. According to |
For the record, I was told that to add a codelet implemented purely in LLVM IR we may have to use |
Oh neat! That was the function I was looking for. That makes sense to me since I was wondering how the mapping from graph to arguments worked. |
According the the docs the ABI is:
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 mappingThe text was updated successfully, but these errors were encountered: