Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SegmentationFault running examples/bench.ts and other examples #49

Closed
asilvas opened this issue Sep 27, 2022 · 5 comments
Closed

SegmentationFault running examples/bench.ts and other examples #49

asilvas opened this issue Sep 27, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@asilvas
Copy link
Contributor

asilvas commented Sep 27, 2022

Running in a vanilla docker container FROM flml/flashlight:cuda-latest.

bun bench.ts
10 elements...
JS create 0 tensor               mean: 25.576us    (min: 19.379us, max: 895.272us)
native create 0 tensor           mean: 4.402us    (min: 2.48us, max: 348.661us)
JS create random tensor          mean: 23.681us    (min: 19.279us, max: 190.88us)
native create random tensor      mean: 12.875us    (min: 7.879us, max: 264.586us)
1000 elements...
JS create 0 tensor               mean: 26.09us    (min: 20.109us, max: 519.052us)
native create 0 tensor           mean: 3.65us    (min: 2.25us, max: 354.776us)
JS create random tensor          mean: 28.209us    (min: 22.628us, max: 388.019us)
native create random tensor      mean: 12.913us    (min: 7.789us, max: 447.59us)
100000 elements...

SegmentationFault at 0x0000000000000000


----- bun meta -----
Bun v0.1.13 (55bdf268) Linux x64 #1 SMP Wed Aug 24 22:24:20 UTC 2022
AutoCommand:
Elapsed: 1630ms | User: 957ms | Sys: 262ms
RSS: 67.11MB | Peak: 1.74GB | Commit: 67.11MB | Faults: 60
----- bun meta -----

I'm able to run benchmark from flashlight in the same container. The host is Win11 /w WSL2.

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01    Driver Version: 516.94       CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:21:00.0  On |                  N/A |
|  0%   45C    P8    26W / 400W |   2120MiB / 12288MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  NVIDIA GeForce ...  On   | 00000000:4B:00.0 Off |                  N/A |
|  0%   35C    P8    19W / 350W |      0MiB / 12288MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
@bwasti
Copy link
Contributor

bwasti commented Sep 27, 2022

are you running from bun install '@shumai/shumai' or a recent pull of the source code?

@jacobkahn any thoughts?

@bwasti bwasti added the bug Something isn't working label Sep 27, 2022
@bwasti bwasti self-assigned this Sep 27, 2022
@bwasti
Copy link
Contributor

bwasti commented Sep 27, 2022

I added a change to the benchmark that might give some info about why things are breaking for you:
0a8bb25

@asilvas
Copy link
Contributor Author

asilvas commented Sep 27, 2022

I added a change to the benchmark that might give some info about why things are breaking for you: 0a8bb25

Thanks for the quick reply. I have the latest shumai installed, but running the examples from latest in main. I updated my local bench.ts to include the gc call. Seems like the crash is during GC.

10 elements...
JS create 0 tensor               mean: 28.896us    (min: 19.199us, max: 2990.723us)

SegmentationFault at 0x0000000000000000


----- bun meta -----
Bun v0.1.13 (55bdf268) Linux x64 #1 SMP Wed Aug 24 22:24:20 UTC 2022
AutoCommand:
Elapsed: 2383ms | User: 769ms | Sys: 489ms
RSS: 67.11MB | Peak: 1.71GB | Commit: 67.11MB | Faults: 495
----- bun meta -----

@bwasti
Copy link
Contributor

bwasti commented Sep 27, 2022

oh, are you on bun canary? (bun upgrade --canary)

I think I hit this issue and it was fixed here: oven-sh/bun@17be802

@asilvas
Copy link
Contributor Author

asilvas commented Sep 27, 2022

Oh sweet, yep that fixed it thanks!

@asilvas asilvas closed this as completed Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants