How to get the execution time for the given function #494
Replies: 11 comments
-
|
The most simple way is to just use If you are look for a more accurate measurement, suppose
|
Beta Was this translation helpful? Give feedback.
-
|
By the way, if you are using the Python |
Beta Was this translation helpful? Give feedback.
-
|
When I called f.collect_returns(), it returns a freetensor array as <freetensor_ffi.Array object at 0x7f75770767b0>. |
Beta Was this translation helpful? Give feedback.
-
|
I used time.time() before but I think there's something wrong with so long time execution time printed, so I want to know if you have any other ideas about the printing time. |
Beta Was this translation helpful? Give feedback.
-
|
I found the problem, since I used numpy array before so the function may execute in CPU, when I changed to Tensor and mapped data on GPU, the execution time seems reasonable. |
Beta Was this translation helpful? Give feedback.
-
This seems like a real illegal memory access in the program. Please make sure your program can safely run for multiple times, especially when there are "inout" parameters.
The device to run the function is decided by |
Beta Was this translation helpful? Give feedback.
-
|
Thanks a lot! When I followed by the docs (https://roastduck.github.io/FreeTensor/guide/ad/) for Automatic Differentiation, an error was found: After I removed the keyword attach_backward, another error was found: I don't know if the docs need to update or if is there something wrong with my compilation. |
Beta Was this translation helpful? Give feedback.
-
|
Another question is the shared memory usage. I used to build a custom function that has matmul on GPU, but the generated code shows it doesn't use shared memory. My custom function is : The generated code is below: Is there any tutorial that can tell me to use shared memory to generate high performance code ? |
Beta Was this translation helpful? Give feedback.
-
The examples in docs is always tested in CI for every commit, so I don't think there will be a problem. Maybe you are running a out-of-date version of FreeTensor, and please pull a latest version from master. Sorry that we still haven't come out with a stable release. |
Beta Was this translation helpful? Give feedback.
-
I see your code has already in parallel. Did you use To use shared memory, you need to modify the program by yourself, either by modify the code directly, or use schedules. To specify shared memory in the code, you need to first tile the loops according to the GPU's hardware parameters. For variables in each tile, add a third argument to You may also use schedules. You need to first use the |
Beta Was this translation helpful? Give feedback.
-
|
I have cloned from the latest version of FreeTensor and made it on my environment today. I just use the first program (https://roastduck.github.io/FreeTensor/guide/first-program/) as the example code but it cannot be executed successfully. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! Recently I followed your docs and write a custom function, but I don't know how to evaluate the execution time.
Is there any document to tell me how to get the execution time of the given function? I saw the FreeTensor/test directory but found those are not what I want.
Beta Was this translation helpful? Give feedback.
All reactions