Skip to content

Feat/backend dispatch mode#35

Merged
VishalVerma249 merged 18 commits into
mainfrom
feat/backend-dispatch-mode
Apr 19, 2026
Merged

Feat/backend dispatch mode#35
VishalVerma249 merged 18 commits into
mainfrom
feat/backend-dispatch-mode

Conversation

@souls-syntax

Copy link
Copy Markdown
Member

We are implementing Backrpop and cpu fallback and the correction of one way transfer logic

@VishalVerma249 VishalVerma249 merged commit 5155f61 into main Apr 19, 2026
1 check passed
@souls-syntax souls-syntax deleted the feat/backend-dispatch-mode branch April 19, 2026 16:44
souls-syntax added a commit that referenced this pull request Apr 20, 2026
* Added time field in make.sh

* chore/ Running summarizer

* Completed MSE, passed smoke tests

Written SUB, SQUARE, MEAN

* chore/ Running summarizer

* made assign grad memory function

* chore/ Running summarizer

* chore/ Running summarizer

* chore/ Running summarizer

* Somewhat work not tested

* Implemented brackprop_b.cpp and added switch statements for op handling

* Corrected the enum missnaming mistake

* BROKEN : THE FUCKING NN IS NOT LEARNING WRRRRRYYYYYYYYY FUCK

* BROKEN 2 : THE FUCKING NN IS NOT LEARNING WRRRRRYYYYYYYYY FUCK

* Working operations there is still problem with routing but will resolve that in some time

Auto grad almost complete

* FAAAAAAAAAAAAAAAAAAAAAAAA: I HAVE COMPLETED THE AUTOGRAD

FAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AUTOGRAD WORKS 4NN XOR WORKS AND LIFE IS BEST

* GPU fallback is working but i feel something is wrong with hybrid path will need to see

* Broken push don't try it it's super broken likely

* CORRECTED: The backend switch and GPU CPU thrashing was resolved, it was some config and default return error

---------

Co-authored-by: Aakarsh Kashyap <souls-syntax@gmail.com>
VishalVerma249 pushed a commit that referenced this pull request Apr 21, 2026
* Added time field in make.sh

* chore/ Running summarizer

* Completed MSE, passed smoke tests

Written SUB, SQUARE, MEAN

* chore/ Running summarizer

* made assign grad memory function

* chore/ Running summarizer

* chore/ Running summarizer

* chore/ Running summarizer

* Somewhat work not tested

* Implemented brackprop_b.cpp and added switch statements for op handling

* Corrected the enum missnaming mistake

* BROKEN : THE FUCKING NN IS NOT LEARNING WRRRRRYYYYYYYYY FUCK

* BROKEN 2 : THE FUCKING NN IS NOT LEARNING WRRRRRYYYYYYYYY FUCK

* Working operations there is still problem with routing but will resolve that in some time

Auto grad almost complete

* FAAAAAAAAAAAAAAAAAAAAAAAA: I HAVE COMPLETED THE AUTOGRAD

FAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AUTOGRAD WORKS 4NN XOR WORKS AND LIFE IS BEST

* GPU fallback is working but i feel something is wrong with hybrid path will need to see

* Broken push don't try it it's super broken likely

* CORRECTED: The backend switch and GPU CPU thrashing was resolved, it was some config and default return error

* Some works and config fallbakc

* Feat/backend dispatch mode (#35)

* Added time field in make.sh

* chore/ Running summarizer

* Completed MSE, passed smoke tests

Written SUB, SQUARE, MEAN

* chore/ Running summarizer

* made assign grad memory function

* chore/ Running summarizer

* chore/ Running summarizer

* chore/ Running summarizer

* Somewhat work not tested

* Implemented brackprop_b.cpp and added switch statements for op handling

* Corrected the enum missnaming mistake

* BROKEN : THE FUCKING NN IS NOT LEARNING WRRRRRYYYYYYYYY FUCK

* BROKEN 2 : THE FUCKING NN IS NOT LEARNING WRRRRRYYYYYYYYY FUCK

* Working operations there is still problem with routing but will resolve that in some time

Auto grad almost complete

* FAAAAAAAAAAAAAAAAAAAAAAAA: I HAVE COMPLETED THE AUTOGRAD

FAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AUTOGRAD WORKS 4NN XOR WORKS AND LIFE IS BEST

* GPU fallback is working but i feel something is wrong with hybrid path will need to see

* Broken push don't try it it's super broken likely

* CORRECTED: The backend switch and GPU CPU thrashing was resolved, it was some config and default return error

---------

Co-authored-by: Aakarsh Kashyap <souls-syntax@gmail.com>

* R

* feat(python): Add flat-C Python bridge layer (sc_bridge)

Introduces include/soft-cuda/python/ with five headers:
  - soft_cuda_python.h  : master include
  - tensor_pool.h       : sc_pool_* arena wrappers
  - tensor_core.h       : sc_tensor_* lifecycle + SC_DTYPE_* constants
  - tensor_ops.h        : sc_tensor_mul/add/relu/... + sc_tensor_evaluate*
  - tensor_graph.h      : sc_graph_t opaque handle, Layer 1 + Layer 2 API
  - tensor_io.h         : sc_save_model / sc_load_model

Adds src/python/sc_bridge.cpp — single C++ TU that implements all sc_*
symbols with extern C linkage, wrapping std::vector via placement-new
in sc_graph_t so Python ctypes/cffi never sees any C++ types.

Updates CMakeLists.txt:
  - Excludes src/python/ from the core GLOB (prevents duplicate symbols)
  - Adds soft_cuda_python SHARED target linked against soft_lib

* fix: Remove stray conflict markers from assignBackend.cu

* docs: Rewrite main.cpp as sc_* API tutorial, add PYTHON_BRIDGE.md

main.cpp:
  - Complete rewrite using only sc_* bridge functions
  - 9 numbered sections: pools, data, weights, lazy ops,
    build_graph, training loop, inference, save/load, cleanup
  - Pure C (no iostream, no std::vector visible)
  - Demonstrates both Layer 2 convenience API (sc_build_graph,
    sc_graph_step) and data readback (sc_tensor_get_data)

docs/PYTHON_BRIDGE.md:
  - Architecture diagram (Python → sc_bridge → soft_lib)
  - Build instructions (cmake targets)
  - Full API reference for all 5 headers with function signatures
  - Complete Python ctypes example (XOR training from Python)
  - Memory model explanation (arena/bump allocation)
  - Design decision rationale (why placement-new, why SC_DTYPE, etc.)

* Some author defination

* Some resolution as well as hoping to correct the API.h in next sitting as there is some graurd resoltion i.e. not happening i think i can do it like this

* Working: Corrected the linker error

---------

Co-authored-by: Aakarsh Kashyap <souls-syntax@gmail.com>
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