Skip to content

Switch back after device!(f, dev) on a fresh task - #1107

Open
luraess wants to merge 1 commit into
mainfrom
lr/restore
Open

luraess wants to merge 1 commit into
mainfrom
lr/restore

Conversation

@luraess

@luraess luraess commented Sep 23, 2026

Copy link
Copy Markdown
Member

On a task with no AMDGPU state yet, context!(ctx) created that state on ctx and returned nothing, so context!(f, ctx) and device!(f, dev) never switched back and left the task on dev. context! now starts from the default state, so there is always a context to switch back to. This also drops the ctx.valid check, which can no longer fail since #605.

pool_cleanup wrapped reclaim() in HIP.device!, but reclaim reads the task-local device, so it trimmed the wrong device's pool. It now uses AMDGPU.device!.

Items 2 and 4 of #1105. The new multi_gpu test fails on main and passes here (mi200, 2 GCDs).

🤖 Generated with Claude Code

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AMDGPU.jl Benchmarks

Details
Benchmark suite Current: ba0404e Previous: 8a66547 Ratio
amdgpu/synchronization/context/device 547.5 ns 550 ns 1.00
amdgpu/synchronization/stream/blocking 225 ns 222.5 ns 1.01
amdgpu/synchronization/stream/nonblocking 305 ns 307.5 ns 0.99
applications/bitonic_sort 1127180.75 ns 1160103.75 ns 0.97
applications/convolution 72141 ns 72376 ns 1.00
applications/floyd_warshall 9023781.25 ns 9100856.25 ns 0.99
applications/histogram 806093.75 ns 798998.75 ns 1.01
applications/prefix_sum 187992.75 ns 190535 ns 0.99
array/accumulate/Float32/1d 69691 ns 79346 ns 0.88
array/accumulate/Float32/dims=1 285226.5 ns 271536.25 ns 1.05
array/accumulate/Float32/dims=1L 83868.75 ns 72536 ns 1.16
array/accumulate/Float32/dims=2 74618.5 ns 74041 ns 1.01
array/accumulate/Float32/dims=2L 3028477.5 ns 2834326.75 ns 1.07
array/accumulate/Int64/1d 79803.5 ns 79098.5 ns 1.01
array/accumulate/Int64/dims=1 248723.5 ns 248393.25 ns 1.00
array/accumulate/Int64/dims=1L 88681.25 ns 89128.75 ns 0.99
array/accumulate/Int64/dims=2 75586 ns 76041 ns 0.99
array/accumulate/Int64/dims=2L 3389059.75 ns 3139866 ns 1.08
array/broadcast 43978.25 ns 50443.25 ns 0.87
array/construct 2192.5 ns 2247.5 ns 0.98
array/copy 39413 ns 39278 ns 1.00
array/copyto!/cpu_to_gpu 85866.25 ns 85676.25 ns 1.00
array/copyto!/gpu_to_cpu 85896 ns 85591.25 ns 1.00
array/copyto!/gpu_to_gpu 58961 ns 58288.25 ns 1.01
array/iteration/findall/bool 128669.25 ns 125954.25 ns 1.02
array/iteration/findall/int 144622 ns 146617 ns 0.99
array/iteration/findfirst/bool 156462.25 ns 155292.25 ns 1.01
array/iteration/findfirst/int 191840.25 ns 189260 ns 1.01
array/iteration/findmin/1d 103671.5 ns 103258.75 ns 1.00
array/iteration/findmin/2d 90151.25 ns 90081.25 ns 1.00
array/iteration/logical 227883.25 ns 226565.5 ns 1.01
array/iteration/scalar 296136.75 ns 295931.5 ns 1.00
array/permutedims/2d 70831 ns 70736 ns 1.00
array/permutedims/3d 47465.75 ns 69253.5 ns 0.69
array/permutedims/4d 75038.75 ns 50278.25 ns 1.49
array/random/rand/Float32 46080.75 ns 40065.75 ns 1.15
array/random/rand/Int64 55490.75 ns 48863 ns 1.14
array/random/rand!/Float32 44710.5 ns 65541 ns 0.68
array/random/rand!/Int64 57668.25 ns 69623.25 ns 0.83
array/random/randn/Float32 69196 ns 71161 ns 0.97
array/random/randn!/Float32 81926 ns 58721 ns 1.40
array/reductions/mapreduce/Float32/1d 81693.75 ns 81621 ns 1.00
array/reductions/mapreduce/Float32/dims=1 74416.25 ns 56660.75 ns 1.31
array/reductions/mapreduce/Float32/dims=1L 840539.25 ns 844514.25 ns 1.00
array/reductions/mapreduce/Float32/dims=2 75808.75 ns 74073.5 ns 1.02
array/reductions/mapreduce/Float32/dims=2L 136992 ns 136524.5 ns 1.00
array/reductions/mapreduce/Int64/1d 81546 ns 81663.5 ns 1.00
array/reductions/mapreduce/Int64/dims=1 74981 ns 73933.5 ns 1.01
array/reductions/mapreduce/Int64/dims=1L 842879.5 ns 839174.25 ns 1.00
array/reductions/mapreduce/Int64/dims=2 75191 ns 75486.25 ns 1.00
array/reductions/mapreduce/Int64/dims=2L 137824.25 ns 137611.75 ns 1.00
array/reductions/reduce/Float32/1d 81348.5 ns 81541.25 ns 1.00
array/reductions/reduce/Float32/dims=1 74341.25 ns 70296 ns 1.06
array/reductions/reduce/Float32/dims=1L 839396.75 ns 836984.25 ns 1.00
array/reductions/reduce/Float32/dims=2 75016 ns 75123.5 ns 1.00
array/reductions/reduce/Float32/dims=2L 136919.5 ns 136774.25 ns 1.00
array/reductions/reduce/Int64/1d 81423.5 ns 81368.75 ns 1.00
array/reductions/reduce/Int64/dims=1 74696 ns 74831 ns 1.00
array/reductions/reduce/Int64/dims=1L 843806.75 ns 844554 ns 1.00
array/reductions/reduce/Int64/dims=2 74978.5 ns 75411.25 ns 0.99
array/reductions/reduce/Int64/dims=2L 137827 ns 137047 ns 1.01
array/reverse/1d 43200.5 ns 43458 ns 0.99
array/reverse/1dL 69886 ns 70606 ns 0.99
array/reverse/1dL_inplace 79388.75 ns 79671 ns 1.00
array/reverse/1d_inplace 33625.5 ns 60390.75 ns 0.56
array/reverse/2d 47708.25 ns 47625.75 ns 1.00
array/reverse/2dL 57253.25 ns 57993.5 ns 0.99
array/reverse/2dL_inplace 79476.25 ns 79096 ns 1.00
array/reverse/2d_inplace 60936 ns 61191 ns 1.00
array/sorting/1d 323484.5 ns 326449.5 ns 0.99
gemm/tiled 2888903 ns 1961659.75 ns 1.47
gemm/tiled_unbounded 1956694.75 ns 1960334.75 ns 1.00
integration/byval/reference 39611 ns 39821 ns 0.99
integration/byval/slices=1 40481 ns 40830 ns 0.99
integration/byval/slices=2 158163 ns 130842 ns 1.21
integration/byval/slices=3 240243 ns 241884 ns 0.99
integration/volumerhs 4877228 ns 4900148 ns 1.00
kernel/indexing 35395.5 ns 41880.5 ns 0.85
kernel/indexing_checked 57765.75 ns 37075.5 ns 1.56
kernel/launch 1155 ns 1130 ns 1.02
kernel/rand 70338.5 ns 70343.5 ns 1.00
latency/import 1457911761 ns 1456646355 ns 1.00
latency/precompile 22612886279 ns 22642954217 ns 1.00
latency/ttfp 2246180072 ns 2251455325 ns 1.00
stencil/diffusion3d 1616775.25 ns 1611230 ns 1.00
stencil/diffusion3d_checked 1658688.25 ns 1655470.5 ns 1.00

This comment was automatically generated by workflow using github-action-benchmark.

This branch has not been deployed

No deployments
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.

1 participant