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)
- How do you represent a object like mesh with data class in taichi?
- Taichi get slower after about 500 loops HOT 2
- All conditional statements ignored in `@ti.func` called from `@ti.real_func` HOT 1
- AutoDiff and AoT
- Doc error in Camera.projection_mode()
- Weird performance for fabric python example on M1 mac with screen size 1024*1024 HOT 3
- Unwanted value while passing values between sparse field
- [MSVC] Taichi failed with error G030630B7: static assertion failed: Unexpected size HOT 2
- Requesting high-order differentiation and high-order partial differentiation
- Autodiff is broken for opengl and vulkan HOT 1
- [BUG] Vector field assignment error in taichi v1.7
- Taichi slower than CUDA/OpenCL HOT 4
- How do I profile taichi func
- Unable to Run Parallel Taichi Simulations Using `concurrent.futures` HOT 1
- taichi.Texture crashes with segmentation fault HOT 1
- video_manager.clean_frames() incorrect path
- Wrong gradient when using taichi autodiff.grad and pytorch autodiff.function together. HOT 2
- Can not find CUDA
- Error when attempting to use GGUI HOT 1
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.