Comments (3)
Another bug found.
import taichi as ti
ti.init(ti.cuda)
@ti.kernel
def mytest():
for _ in range(1):
x = ti.Vector.zero(ti.f32, 1)
x[0] = 1
res = ti.Vector.zero(ti.f32, 1)
for i in range(1):
res[i] = 2
x = res
print(x)
print(x[0])
mytest()
The output is
$ python3 ti_vec_func2.py
[Taichi] version 1.8.0, llvm 15.0.4, commit 0da68467, linux, python 3.8.10
[Taichi] Starting on arch=cuda
[2.000000]
1.000000
from taichi.
I also found a puzzling manifestation of taichi,
import taichi as ti
import numpy as np
ti.init(arch=ti.gpu)
num = int(1e9)
@ti.kernel
def speed_test()->ti.float32:
ti.loop_config(serialize=True)
s2 = 0.0
for i in range(num):
s2+=1.0
return s2
print(speed_test())
a = np.ones(num,dtype=np.float32)
res = np.array(0.0,dtype=np.float32)
a.sum(out=res)
print(res)
The output is:
[Taichi] version 1.7.1, llvm 15.0.4, commit 0f143b2f, linux, python 3.11.9
[Taichi] Starting on arch=cuda
536870912.0
1000000000.0
from taichi.
@Dinngger for your original post, that case is not a bug. Kernel parameters are constant, we supported the syntax because some people relied on the C-like behavior, but the results only persists within a single offload. (e.g. within a single parallel for loop)
We probably should make it a warning
For the second case, weird indeed. I would guess some bug with load to store forwarding did not detect a modification
from taichi.
Related Issues (20)
- Can not find CUDA
- Error when attempting to use GGUI HOT 1
- Struct field with offset crashes
- Error when `from __future__ import annotations`
- How can I deal with data race when I am creating a taichi-based hash map? The code runs successfully on CPU single thread.
- What does runtime_retrieve_and_reset_error_code mean?
- Unnecessary "Possible loss of precision" warning HOT 3
- Taichi ndarray element assignment not working
- Discrepancy in AOT Module Size and Runtime Efficiency Based on Kernel Execution State
- Browser GUI HOT 1
- Discrepancy in AOT Module Size and Runtime Efficiency Based on Kernel Execution State
- Inconsistent, but seemingly deterministic crash of runtime in debug mode (repro attached)
- Having trouble retrieving the real distances from camera's eye using depth.
- The same code works on Nvidia CUDA but doesn't work on AMD Vulkan
- cache loop invariant global vars pass induces incorrect results
- cache loop invariant global vars pass induces incorrect results in serial mode
- The behavior of property method in the subclass inherited from a data oriented class may need more clarification in document
- SparseMatrix build_from_ndarray error in cuda
- SparseMatrix build_from_ndarray error when triplets shape lager than 85
- Why is it so much slower to turn on a gpu than not
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from taichi.