MCPcopy Create free account
hub / github.com/UbiquitousLearning/mllm / main

Function main

tests/compile/ir/ProgramLoweringTest.cpp:34–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32};
33
34int main() {
35 mllm::initializeContext();
36 {
37 auto net = FooNet("foo_net");
38
39 // Make some fake weights
40 auto params = ParameterFile::create();
41 for (int i = 0; i < 4; ++i) {
42 auto name = "foo_net.linear_" + std::to_string(i);
43 auto w = Tensor::empty({2048, 1024}).setMemType(kParamsNormal).setName(name + ".weight");
44 auto b = Tensor::empty({2048}).setMemType(kParamsNormal).setName(name + ".bias");
45 params->push(w.name(), w);
46 params->push(b.name(), b);
47 }
48 net.load(params);
49
50 auto ir_ctx = mllm::ir::trace(net, Tensor::empty({2, 1, 312, 1024}, kFloat32));
51
52 // Lowering
53 auto pm = mllm::ir::PassManager(ir_ctx);
54 pm.reg(mllm::ir::createProgramLoweringPipeline());
55 pm.run();
56
57 print(ir_ctx);
58 }
59 mllm::memoryReport();
60}

Callers

nothing calls this directly

Calls 14

traceFunction · 0.85
PassManagerClass · 0.85
printFunction · 0.85
FooNetClass · 0.70
initializeContextFunction · 0.50
emptyFunction · 0.50
memoryReportFunction · 0.50
setNameMethod · 0.45
pushMethod · 0.45
nameMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected