Skip to content

[WIP] Removal of the C++ Runtime files that are not needed#3392

Open
AlexandreEichenberger wants to merge 7 commits intoonnx:mainfrom
AlexandreEichenberger:cpprt
Open

[WIP] Removal of the C++ Runtime files that are not needed#3392
AlexandreEichenberger wants to merge 7 commits intoonnx:mainfrom
AlexandreEichenberger:cpprt

Conversation

@AlexandreEichenberger
Copy link
Collaborator

@AlexandreEichenberger AlexandreEichenberger commented Feb 12, 2026

Removed the unused C++ files in the onnx-mlir/Runtimes subdirectory, edited the CMakelist.txt accordingly.

Signed-off-by: Alexandre Eichenberger <alexe@us.ibm.com>
Signed-off-by: Alexandre Eichenberger <alexe@us.ibm.com>
Signed-off-by: Alexandre Eichenberger <alexe@us.ibm.com>
Signed-off-by: Alexandre Eichenberger <alexe@us.ibm.com>
Signed-off-by: Alexandre Eichenberger <alexe@us.ibm.com>
@AlexandreEichenberger
Copy link
Collaborator Author

@chentong319 would you be able to test this PR in your env, as we don't have too much for the lightweight testing as this time?
Or accept changes and I can fix issues specific to your use case?

@chentong319
Copy link
Collaborator

I tested your PR. It got error for tests/helloworld.py.

undefined symbol: OM_DATA_TYPE_SIZE

@AlexandreEichenberger
Copy link
Collaborator Author

@chentong319 thanks, let me look into it.

@chentong319
Copy link
Collaborator

By the way, I tried to link cruntime when model.so is loaded and the program can run correctly. That could be an alternative solution. To remove cruntime from the static linked libraries for model.so, we need:

  1. change the link command in onnx-mlir, remove cruntime and add -lm.
  2. Change CMakeList.txt to build a dynamic lib for cruntime.
  3. Change OMPyInfer to load the cruntime from the package.

I am thinking about a separate PR for this change.

Signed-off-by: Alexandre Eichenberger <alexe@us.ibm.com>
@AlexandreEichenberger
Copy link
Collaborator Author

AlexandreEichenberger commented Feb 17, 2026

@chentong319 yes, I think we should unlink the cruntime from the model, and build it in the light. Its already the case that the OMTensorUtils contains cruntime in the non-light version; I think for C programs, we should only link the cruntime; for CPP programs, we should only link what we currently call OMExecutionSession(and should be renameOMCppRuntime); and for python we should only link the python version of the execution session, which should in turn load both the cruntime, the OMExecutionSession` plus the python version of it.

In any case, I have re-added the missing constants, so please do a new test please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants