Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
300f21b
Initial implementation for ALPAKA integration to SOFIE
sanjibansg Apr 11, 2025
fc9846c
GPU ALPAKA Support in GEMM
sanjibansg Apr 11, 2025
419b354
fix: errors with the generation function
sanjibansg Apr 11, 2025
6481c05
fix: defining intermediate and initialized tensors
sanjibansg Aug 18, 2025
e31303f
feat: use sofieblas efficiently and add leaky relu, sigmoid support
sanjibansg Oct 14, 2025
afae7c3
feat: add basic binary kernel
sanjibansg Oct 17, 2025
c845fe7
feat: add cast kernel
sanjibansg Oct 17, 2025
3d9f812
feat: add squeeze, unsqueeze, flatten and reshape
sanjibansg Oct 21, 2025
284405e
feat: add support for basic unary
sanjibansg Oct 21, 2025
d64a40f
feat: add support for Constant operator
sanjibansg Oct 21, 2025
ac8d662
feat: add support for shape operator
sanjibansg Oct 22, 2025
d75eac3
feat: add support for Basic Binary operations
sanjibansg Nov 20, 2025
f7e44ad
fix: compilation issues due to faulty rebase
sanjibansg Nov 23, 2025
b4cd917
fix: parameteric inputs for range operator
sanjibansg Nov 23, 2025
2016794
fix: linking issue because of incorrect symbols
sanjibansg Nov 24, 2025
f35d9d9
fix: cmake script for tests
sanjibansg Nov 27, 2025
cdc6a9f
fix: define failures in EmitFromRoot.cxx.in (#6)
Saransh-cpp Dec 2, 2025
3ffbe46
fix: layout inconsistencies in alpaka code generation
sanjibansg Dec 14, 2025
1979a11
feat: turn off emitting from ROOT files and skip tests with multiple …
sanjibansg Dec 15, 2025
59aeac4
feat: support for google tests for inference code with alpaka impleme…
sanjibansg Dec 15, 2025
815a80c
feat: test cases for leaky relu operator
sanjibansg Jan 26, 2026
671b4b0
fix: sigmoid operator gpu implementation and test
sanjibansg Jan 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"files.associations": {
"*.icc": "cpp",
"limits": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"compare": "cpp",
"complex": "cpp",
"concepts": "cpp",
"cstdint": "cpp",
"deque": "cpp",
"map": "cpp",
"set": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"regex": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"new": "cpp",
"numbers": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp",
"charconv": "cpp",
"chrono": "cpp",
"condition_variable": "cpp",
"list": "cpp",
"ratio": "cpp",
"future": "cpp",
"mutex": "cpp",
"semaphore": "cpp",
"shared_mutex": "cpp",
"span": "cpp",
"stop_token": "cpp",
"thread": "cpp",
"cfenv": "cpp",
"variant": "cpp",
"format": "cpp",
"any": "cpp",
"source_location": "cpp",
"run_inference_particle_net.C": "cpp",
"test.C": "cpp"
}
}
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ source setup.sh
```
Now ROOT should also access the SOFIE libraries while it runs. This helps to accelerate development. Submit your developments here and we will proceed with the developments in ROOT carefull.


3. To enable testing generated code with alpaka implementations, build using the following command:
```bash
cmake -Dtesting=ON -DENABLE_ALPAKA_TESTS=ON -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
```
The default architecture is CUDA, but can be configured using an additional`-DALPAKA_BACKEND=hip` cmake option.

## Inspiration
The standalone version of SOFIE is developed with inspiration from the standalone version of RooFit developed by Jonas Rembser that can be found [here](https://github.com/guitargeek/roofit).
7 changes: 7 additions & 0 deletions settings-dev.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "" FORCE)
set (CMAKE_INSTALL_PREFIX ../install CACHE STRING "" FORCE)
set (CMAKE_INSTALL_BINDIR bin CACHE STRING "" FORCE)
set (CMAKE_INSTALL_INCLUDEDIR include CACHE STRING "" FORCE)
set (CMAKE_INSTALL_LIBDIR lib CACHE STRING "" FORCE)
set (testing ON CACHE BOOL "" FORCE)
set (mathmore ON CACHE BOOL "" FORCE)
61 changes: 61 additions & 0 deletions src/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"files.associations": {
"*.icc": "cpp",
"iostream": "cpp",
"ostream": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"bitset": "cpp",
"compare": "cpp",
"complex": "cpp",
"concepts": "cpp",
"cstdint": "cpp",
"deque": "cpp",
"map": "cpp",
"set": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"regex": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"numbers": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp"
}
}
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ set(sofie_legacy_eval_backend ON CACHE BOOL "" FORCE)

add_subdirectory(SOFIE_core)
add_subdirectory(SOFIE_parsers)
add_subdirectory(utils)
9 changes: 8 additions & 1 deletion src/SOFIE_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ list(TRANSFORM sources_headers PREPEND "inc/")
set(sources_cxx
src/RModel_Base.cxx
src/RModel.cxx
src/RModel_ALPAKA.cxx
src/RModel_GNN.cxx
src/RModel_GraphIndependent.cxx
src/RFunction.cxx
Expand All @@ -87,18 +88,24 @@ set(sources_cxx

target_sources(SOFIE_core PRIVATE ${sources_headers} ${sources_cxx})
target_include_directories(SOFIE_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc)
target_link_libraries(SOFIE_core PUBLIC utils)
target_link_libraries(SOFIE_core PUBLIC
Tree
Core
RIO
)

ROOT_GENERATE_DICTIONARY(G__SOFIE ${sources_headers}
ROOT_GENERATE_DICTIONARY(G__SOFIE_core ${sources_headers}
LINKDEF inc/LinkDef.h
MODULE SOFIE_core
OPTIONS --deep
)

# Install the dictionaries.
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libSOFIE_core_rdict.pcm
${CMAKE_CURRENT_BINARY_DIR}/libSOFIE_core.rootmap
DESTINATION lib)

install(TARGETS SOFIE_core
LIBRARY DESTINATION lib
)
Expand Down
3 changes: 0 additions & 3 deletions src/SOFIE_core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ SOFIE works in a parser-generator working architecture. With SOFIE, the user get
From ROOT command line, or in a ROOT macro, we can proceed with an ONNX model:

```c++
using namespace TMVA::Experimental;
SOFIE::RModelParser_ONNX parser;
SOFIE::RModel model = parser.Parse(“./example_model.onnx”);
model.Generate();
Expand Down Expand Up @@ -73,7 +72,6 @@ SOFIE also supports generating inference code with RDataFrame as inputs, refer t

Here is the updated list of supported ONNX operators. You can obtain this list by doing
```cpp
using namespace TMVA::Experimental;
SOFIE::RModelParser_ONNX parser;
std::vector<std::string> supportedOperators = parser.GetRegisteredOperators();
```
Expand Down Expand Up @@ -164,7 +162,6 @@ The above operators are supported for tensors of the following types:

You can also check your model whether all operators are implemented by doing the following:
```c++
using namespace TMVA::Experimental;
SOFIE::RModelParser_ONNX parser;
parser.CheckModel("example_model.ONNX");
```
Expand Down
1 change: 1 addition & 0 deletions src/SOFIE_core/inc/SOFIE/RFunction.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "SOFIE/RModel_Base.hxx"
#include "SOFIE/SOFIE_common.hxx"
#include "SOFIE/ROperator.hxx"

#include <memory>
#include <string>
Expand Down
Loading