Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
301c60d
writing new IR
MichaelMoroz May 28, 2025
09102c6
Working on new IR
MichaelMoroz Jun 1, 2025
3713ac3
NUKE EVERYTHING
MichaelMoroz Jun 1, 2025
bd53f72
Some tests
MichaelMoroz Jun 1, 2025
60268b1
Working super minimal test
MichaelMoroz Jun 1, 2025
71e42d3
Basic IR printing
MichaelMoroz Jun 1, 2025
0c1885b
Various improvements
MichaelMoroz Jun 1, 2025
b691c9b
Working on IR
MichaelMoroz Jun 9, 2025
98cea8f
Better print + TFProgram
MichaelMoroz Jun 10, 2025
8a4f18d
Simple compilation pass
MichaelMoroz Jun 10, 2025
ed1679a
Verbose print
MichaelMoroz Jun 10, 2025
8254078
Make value wrapper
MichaelMoroz Jun 10, 2025
36fc4d5
Fix value wrapper
MichaelMoroz Jun 10, 2025
b38baf0
Unused operation removal
MichaelMoroz Jun 10, 2025
b6627cc
Improved compiler
MichaelMoroz Jun 15, 2025
1cb4c2d
Refactoring operation handling
MichaelMoroz Jun 16, 2025
dc4ae1b
Rewrite tuples as indexed values
MichaelMoroz Jun 17, 2025
d42835a
Add basic vulkan backend
MichaelMoroz Aug 16, 2025
e26f6a4
Basic vulkan binds on python
MichaelMoroz Aug 24, 2025
f840a50
Vulkan, GLFW and frontend
MichaelMoroz Aug 25, 2025
6b848f5
Refactor vulkan interface
MichaelMoroz Nov 5, 2025
63cd0ca
Use global vulkan context on backend
MichaelMoroz Nov 5, 2025
c81072c
Refactor project structure
MichaelMoroz Nov 6, 2025
c260a24
Comment out of date tests
MichaelMoroz Nov 6, 2025
c5b48a2
vulkan imgui integration
MichaelMoroz Nov 6, 2025
b5c6dbd
Add window resizing support
MichaelMoroz Nov 6, 2025
a988db6
Move old examples into legacy examples
MichaelMoroz Nov 6, 2025
1aa3a63
Add additional ImGui features
MichaelMoroz Nov 6, 2025
a301c73
Mouse control support added to window
MichaelMoroz Nov 6, 2025
e509dfa
radix sort example
MichaelMoroz Nov 7, 2025
5ab3063
Add renderdoc integration
MichaelMoroz Nov 7, 2025
b1f5555
Have a replay ui show option for renderdoc
MichaelMoroz Nov 7, 2025
2c773fb
Add test
MichaelMoroz Nov 7, 2025
155bf28
Properly specify group count
MichaelMoroz Nov 7, 2025
f304c4f
Update sorting example
MichaelMoroz Nov 8, 2025
426da84
Use deviceLocal buffers only
MichaelMoroz Nov 8, 2025
e95c500
Update sort example
MichaelMoroz Nov 8, 2025
7a21349
Update PybindModule.cpp
MichaelMoroz Nov 8, 2025
822dc59
Move legacy tests
MichaelMoroz Nov 8, 2025
bd3e2de
Remove manual releases.
MichaelMoroz Nov 9, 2025
dd1f686
Remove more useless code
MichaelMoroz Nov 9, 2025
036e79b
Use push constants everywhere
MichaelMoroz Nov 9, 2025
dd29878
Remove push const reflection
MichaelMoroz Nov 9, 2025
2d98257
counting sort
MichaelMoroz Dec 22, 2025
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ imgui.ini
*.npz
/cmake-build-*
*.pyc
/.cmake
/CMakeFiles
/.debug
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
[submodule "external/glfw"]
path = external/glfw
url = https://github.com/glfw/glfw.git
[submodule "external/glad"]
path = external/glad
url = https://github.com/Dav1dde/glad.git
[submodule "external/imgui"]
path = external/imgui
url = https://github.com/ocornut/imgui.git
[submodule "Python/external/shaderc"]
path = Python/external/shaderc
url = https://github.com/google/shaderc
2 changes: 1 addition & 1 deletion .idea/TensorFrost.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/copilot.data.migration.agent.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

352 changes: 58 additions & 294 deletions .idea/editor.xml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .run/TensorFrost.run.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="TensorFrost" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="H:\TensorFrost\examples\debug.py" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$PROJECT_DIR$" PASS_PARENT_ENVS_2="true" PROJECT_NAME="TensorFrost" TARGET_NAME="TensorFrost" CONFIG_NAME="Debug-Visual Studio" RUN_PATH="$USER_HOME$/AppData/Local/Programs/Python/Python312/python.exe">
<configuration default="false" name="TensorFrost" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="H:\TensorFrost\examples\Slang\mandelbrot.py" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$PROJECT_DIR$" PASS_PARENT_ENVS_2="true" PROJECT_NAME="TensorFrost" TARGET_NAME="TensorFrost" CONFIG_NAME="RelWithDebInfo" RUN_PATH="C:/Python313/python.exe">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
Expand Down
10 changes: 10 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Agent Guide

Follow these expectations whenever you work in this repository:

1. **Full rebuild & virtual environment** — Run `setup_python_env.cmd` from the repo root. It configures the Python virtual environment and performs a clean rebuild so you start from a consistent state.
2. **Partial rebuilds** — Use CMake for incremental builds. Invoke the appropriate CMake build command (for example, `cmake --build <build-directory> --target <target>`) to rebuild only what you need.
3. **C++ changes** — Any edits under `TensorFrost/` or other C++ sources require a rebuild before the changes take effect.
4. **Python script changes** - After edits of python script, you should run them to make sure they work correctly. No recompilation needed.
5. **API validation** — After modifying functionality, run the relevant tests in the `tests/` folder to confirm the Python API still behaves as expected.
6. **Scenario validation** — Run the sample programs in the `examples/` folder to make sure the updated stack handles more complex end-to-end flows.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(PYBIND11_FINDPYTHON ON)

find_package(Vulkan REQUIRED)

add_subdirectory(external/pybind11)
add_subdirectory(external/glfw)
add_subdirectory(external/glad/cmake)
add_subdirectory(TensorFrost)
add_subdirectory(examples)

set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT TensorFrost)
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT TensorFrost)
16 changes: 16 additions & 0 deletions ProtoIR.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Node = [name, arguments, attributes]


n = input_dim(attributes{type=int32, input_index=0, dim_index=0})
a = input(args{shape=[n]}, attributes{type=float32, input_index=0})
b = sin(args{input=[a], shape=[n]}, attributes{type=float32})
c = load(args{input=[b], indices=[0]}, attributes{type=float32})
d = average(args{input=[b]}, attributes{type=float32})
res = div(args{input=[d,c]}, attributes{type=float32})
ids = parallel(args{shape=[n, n]}, attributes{type=tuple}) {
i = unpack_tuple(args{input=[ids,0]}, attributes{type=int32})
j = unpack_tuple(args{input=[ids,0]}, attributes{type=int32})
a0 = load(args{input=[b], indices=[i]}, attributes{type=float32})
a1 = load(args{input=[b], indices=[j]}, attributes{type=float32})
outer = mul(args{input=[a0, a1]}, attributes{type=float32, output_index=0})
}
1 change: 0 additions & 1 deletion Python/TensorFrost/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from . import regularizers
from . import clipping
from . import random
from . import sort
from .default import *

# def compile(func):
Expand Down
10 changes: 5 additions & 5 deletions Python/TensorFrost/clipping.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .optimizers import *

clamp = ModuleOptimizer.ClippingType.Clamp
norm = ModuleOptimizer.ClippingType.Norm
none = ModuleOptimizer.ClippingType.None_
# from .optimizers import *
#
# clamp = ModuleOptimizer.ClippingType.Clamp
# norm = ModuleOptimizer.ClippingType.Norm
# none = ModuleOptimizer.ClippingType.None_
28 changes: 14 additions & 14 deletions Python/TensorFrost/default.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from . import TensorFrost as tf

def zeros_like(tensor):
return tf.zeros(tensor.shape, tensor.type)

def eye(n):
i, j = tf.indices([n, n])
return tf.select(i == j, 1.0, 0.0)

def eye_like(tensor):
return eye(tensor.shape[0])

def ones_like(tensor):
return tf.ones(tensor.shape, tensor.type)
# from . import TensorFrost as tf
#
# def zeros_like(tensor):
# return tf.zeros(tensor.shape, tensor.type)
#
# def eye(n):
# i, j = tf.indices([n, n])
# return tf.select(i == j, 1.0, 0.0)
#
# def eye_like(tensor):
# return eye(tensor.shape[0])
#
# def ones_like(tensor):
# return tf.ones(tensor.shape, tensor.type)
Loading