diff --git a/check.txt b/check.txt deleted file mode 100644 index c67d295..0000000 --- a/check.txt +++ /dev/null @@ -1,2 +0,0 @@ -To github.com:builders-lab/soft-cuda.git - 512d19a..deb1883 feat/matmul -> feat/matmul diff --git a/include/soft-cuda/tensor/api.h b/include/soft-cuda/tensor/api.h index 31d69d1..befb6e9 100644 --- a/include/soft-cuda/tensor/api.h +++ b/include/soft-cuda/tensor/api.h @@ -141,6 +141,7 @@ size_t tensor_pool_used(tensor_pool_t *pool); // bool tensor_move_device(tensor_t *t, device_type target_device, tensor_pool_t *pool); // NEW IMPLEMENTATION +// DONE bool execution_node_to_host(execution_node_t *node); //////////////////////////////////////////////////////////////////////////////////////////// @@ -217,6 +218,7 @@ tensor_t *tensor_transpose(tensor_pool_t *pool, tensor_t *a); tensor_t *tensor_add(tensor_pool_t *pool, tensor_t *x, tensor_t *y); // Explicit broadcasting for layers (e.g., Y = XW + b) +// DONE tensor_t *tensor_add_bias(tensor_pool_t *pool, const tensor_t *xw, const tensor_t *bias); ///////////////////////////////////////////////////////////// @@ -237,6 +239,7 @@ tensor_t *tensor_add_bias(tensor_pool_t *pool, const tensor_t *xw, const tensor_ // @params out Output tensor // @param a Input tensor +// DONE tensor_t *tensor_relu(tensor_pool_t *pool, tensor_t *a); // Compares result @@ -250,9 +253,13 @@ bool tensor_fill_random_normal(tensor_t *t, float mean, float std_dev); tensor_t *tensor_cross_entropy_loss(tensor_pool_t *pool, const tensor_t *predictions, const tensor_t *targets); +// *********************************************************************************** +// TODO: HAVE TO UPDATED FUNC SIG SPEC // Evalutes the operation(Forward) with depth=1 // @return boolean flag for status +// DONE bool tensor_evaluate( tensor_pool_t *pool,tensor_t *t, float *d_a, float *d_b, float *d_res); +// DONE bool tensor_evaluate_GPU( tensor_pool_t *pool,tensor_t *t, float *d_a, float *d_b, float *d_res); ///////////////////////////////////////////////////////////// diff --git a/main.cpp b/main.cpp index 0f6d94e..84fc8b6 100644 --- a/main.cpp +++ b/main.cpp @@ -55,7 +55,7 @@ int main() { if (oki) { cout << "=========================================== \n"; - cout << "========= TACTICAL VRAM TRACE ============= \n"; + cout << "========= VRAM TRACE ============= \n"; execution_node_t *node = seq.back(); diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d55a677 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +black +ipython +matplotlib +pillow +requests +lxml +mercurial +meson +psutil diff --git a/Experiments/broadcasting_add.py b/scripts/Experiments/broadcasting_add.py similarity index 100% rename from Experiments/broadcasting_add.py rename to scripts/Experiments/broadcasting_add.py diff --git a/misc/add.cu b/scripts/Experiments/misc/add.cu similarity index 100% rename from misc/add.cu rename to scripts/Experiments/misc/add.cu diff --git a/scripts/coldstart/.gitignore b/scripts/coldstart/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/scripts/coldstart/.gitignore @@ -0,0 +1 @@ +.env diff --git a/scripts/coldstart/coldstart.prev b/scripts/coldstart/coldstart.prev new file mode 100644 index 0000000..e69de29 diff --git a/scripts/coldstart/coldstart.sh b/scripts/coldstart/coldstart.sh new file mode 100755 index 0000000..8b3c45f --- /dev/null +++ b/scripts/coldstart/coldstart.sh @@ -0,0 +1,24 @@ +cp coldstart.tmp coldstart.prev 2>/dev/null + +git add .. + +git commit -m "chore/ Running summarizer" +date=$(date +%Y-%m-%d_%H-%M-%S) +filename="agent_summary_${date}.log" +{ + echo "=== GIT LOG ===" + git log --oneline -7 + echo "=== GIT DIFF ===" + git diff HEAD + echo "=== TODO ===" + grep -r TODO ../src/ 2>/dev/null + echo "=== PREVIOUS SESSION SUMMARY ===" + [ -f coldstart.prev ] && cat coldstart.prev +} | python coldstart_agent.py > logs/${filename} + +cat logs/${filename} > coldstart.tmp + + +git add .. + +git commit -m "chore/ Summarizer completion logging" diff --git a/scripts/coldstart/coldstart_agent.py b/scripts/coldstart/coldstart_agent.py new file mode 100644 index 0000000..bf0a74f --- /dev/null +++ b/scripts/coldstart/coldstart_agent.py @@ -0,0 +1,29 @@ +import os +from dotenv import load_dotenv, dotenv_values +from google import genai +from google.genai import types +import sys +load_dotenv() + +client = genai.Client() + +with open("system_prompt.txt", "r") as f: + SYSTEM_PROMPT= f.read() + +history = sys.stdin.read() + + +res = client.models.generate_content( + model="gemini-3-flash-preview", + config=types.GenerateContentConfig( + system_instruction=SYSTEM_PROMPT, + thinking_config=types.ThinkingConfig(thinking_level="medium") + ), + contents=history +) + +reply = res.text + +# NOTE: we are just printing it we will handle inputing in file in bash + +print(reply) diff --git a/scripts/coldstart/system_prompt.txt b/scripts/coldstart/system_prompt.txt new file mode 100644 index 0000000..4ba15aa --- /dev/null +++ b/scripts/coldstart/system_prompt.txt @@ -0,0 +1,61 @@ +You are reconstructing the developer’s mental context after a break. + +You are given a codebase snapshot containing: +- TODO comments +- Inline comments +- Recent changes +You will receive a raw data dump separated by headers (=== GIT LOG ===, === GIT DIFF ===, etc.). Use the previous session summary as your baseline, and use the diff/log to determine what changed +Your job is NOT to summarize code blindly. +Your job is to rebuild what the developer was thinking. + +--- + +## OBJECTIVE + +Extract intent, unfinished work, and next steps so the developer can resume instantly. + +--- + +## OUTPUT FORMAT + +### 1. What I Was Doing +- Current feature or problem being worked on +- Main goal in plain English + +### 2. Active TODOs (Grouped) +- Group TODOs by feature or module +- Convert vague TODOs into clear tasks +- Highlight anything critical vs optional + +### 3. Current State of the Code +- What is already implemented +- What is partially done +- What is missing + +### 4. My Likely Next Steps +- Step-by-step continuation plan +- Order tasks logically (what should be done first) + +### 5. Important Context I Should Not Forget +- Assumptions in the code +- Hacks / temporary fixes +- Constraints (performance, design decisions, etc.) + +### 6. Risks / Tricky Areas +- Parts of the code that may break +- Areas that require careful thinking + +--- + +## RULES + +- Prioritize TODOs and comments over everything else +- Infer intent even if comments are messy or incomplete +- Do NOT restate large chunks of code +- Translate developer shorthand into clear reasoning +- Be practical, not verbose +- If something is unclear, state the uncertainty explicitly + +--- + +You are helping the developer avoid the “what was I even doing?” moment. diff --git a/nsys_easy.sh b/scripts/nsys_easy.sh similarity index 100% rename from nsys_easy.sh rename to scripts/nsys_easy.sh diff --git a/src/backend_cpu/math/relu.cpp b/src/backend_cpu/math/relu.cpp index dda46cf..6d85090 100644 --- a/src/backend_cpu/math/relu.cpp +++ b/src/backend_cpu/math/relu.cpp @@ -18,7 +18,7 @@ bool tensor_op_relu(tensor_pool_t *pool, tensor_t *t) { assert(pool != NULL); assert(t != NULL); - float* float_data = ((float*)(t->data)); + float* float_data = ((float*)(t->a->data)); for(uint32_t i = 0; i < t->nvalues; i++) { if (float_data[i] < 0) {