Skip to content

(WIP) Add cpu execution mode for abs kernel (jit mode)#160

Draft
zouzias wants to merge 9 commits into
mainfrom
159-add-cpu-execution-mode-for-abs-kernel
Draft

(WIP) Add cpu execution mode for abs kernel (jit mode)#160
zouzias wants to merge 9 commits into
mainfrom
159-add-cpu-execution-mode-for-abs-kernel

Conversation

@zouzias
Copy link
Copy Markdown
Collaborator

@zouzias zouzias commented May 13, 2026

To reproduce

make compile_cpu_abs
g++-15 -fPIC -shared -D__CPU_SIM -std=c++20 \
        -Icsrc/kernel \
        -I/usr/local/Ascend/cann-9.0.0/include \
        -D_FORTIFY_SOURCE=2 -Wno-macro-redefined -Wno-ignored-attributes \
        -fstack-protector-strong \
        csrc/kernel/kernel_abs.cpp \
        -o libkernel_abs.so
python run_abs_cpu.py 
Loaded library from /home/zouzias/github-repos/pto-kernels/libkernel_abs.so
Is all close? True
tensor([0.0276, 0.6040, 1.5723, 1.1709, 2.3477, 0.2180, 0.5034, 0.5659, 0.7349,
        1.4131], dtype=torch.float16)
tensor([0.0276, 0.6040, 1.5723, 1.1709, 2.3477, 0.2180, 0.5034, 0.5659, 0.7349,
        1.4131], dtype=torch.float16)

@zouzias zouzias linked an issue May 13, 2026 that may be closed by this pull request
@zouzias zouzias changed the title 159 add cpu execution mode for abs kernel Add cpu execution mode for abs kernel (jit mode) May 13, 2026
@zouzias zouzias changed the title Add cpu execution mode for abs kernel (jit mode) (WIP) Add cpu execution mode for abs kernel (jit mode) May 13, 2026
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.

Add CPU execution mode for abs kernel

1 participant