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

Add per-task metrics #56320

Merged
merged 56 commits into from
Dec 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
85b89f4
basic task cpu time tracking
vilterp Jan 26, 2023
dad31b0
initialize to zero
vilterp Jan 26, 2023
3802448
make new task field visible from Julia
vilterp Jan 26, 2023
bbe8b29
add start time
vilterp Jan 26, 2023
480b916
fix typo
vilterp Jan 26, 2023
be8c1a2
add test
vilterp Jan 26, 2023
ad8c184
add a wait
vilterp Jan 26, 2023
e37004a
import `LinearAlgebra` for `peakflops`
vilterp Jan 27, 2023
6e4fd27
update last scheduled on task finish as well
vilterp Jan 31, 2023
8721245
no need to update last scheduled in finish
vilterp Feb 3, 2023
a2c98fa
add test
vilterp Jun 23, 2023
c5562d7
fix test
vilterp Jun 23, 2023
9685032
Add per-task wall-time
nickrobinson251 Oct 16, 2024
fa4f0e8
Test individual task cpu_time less than wall_time
nickrobinson251 Oct 17, 2024
89f8239
More tests
nickrobinson251 Oct 17, 2024
6b0855e
Move task timings mostly to julia
nickrobinson251 Oct 21, 2024
5e7e385
Record cpu time on entrance to `wait/yield`
nickrobinson251 Oct 23, 2024
182c1a5
Rename 'scheduled_at' -> '[en/de]queued_at'
nickrobinson251 Oct 24, 2024
b60f3c4
Ability to enable/disable task timings globally
nickrobinson251 Oct 24, 2024
7e871e2
fixup whitespace
nickrobinson251 Oct 24, 2024
523d936
Enable task timing in test
nickrobinson251 Oct 24, 2024
2c7aa36
Enable task timing for root task
nickrobinson251 Oct 28, 2024
70c56b5
Prevent `task_timing(false)` decrementing below zero
nickrobinson251 Oct 28, 2024
1b60b9f
Change task-timing flag to require yes/no arg
nickrobinson251 Oct 28, 2024
81cd488
Rename `timings`->`metrics`, `dequeued`->`started_running`
nickrobinson251 Oct 28, 2024
a42d524
Update task-state-transition comments
nickrobinson251 Oct 28, 2024
9b35821
Remove unused debug function
nickrobinson251 Oct 28, 2024
8fcc685
Add NEWS
nickrobinson251 Oct 28, 2024
6e248ef
Add fallback recording of cpu time in `wait()`
nickrobinson251 Oct 28, 2024
8b0d493
Instrument async io
nickrobinson251 Oct 28, 2024
81edb59
Record task cpu time in `wait()`
nickrobinson251 Oct 28, 2024
0863ab0
fixup! Record task cpu time in `wait()`
nickrobinson251 Oct 30, 2024
ea1a6f4
fixup! Change task-timing flag to require yes/no arg
nickrobinson251 Oct 30, 2024
a6724d3
Make task metrics flag const and counters atomic
nickrobinson251 Oct 30, 2024
e9e1e65
Mark the new APIs experimental
nickrobinson251 Oct 30, 2024
6c57fd7
Return task metrics as Int or nothing if disabled
nickrobinson251 Oct 30, 2024
7167d87
Test metrics updating as expected
nickrobinson251 Oct 30, 2024
6bdb7a8
fixup! Make task metrics flag const and counters atomic
nickrobinson251 Oct 31, 2024
dae7627
More tests
nickrobinson251 Oct 31, 2024
f5b55f2
Update test/core.jl
nickrobinson251 Oct 31, 2024
2532e24
Introduce `current_task_*_time_ns` for non-racy continuous metrics
nickrobinson251 Oct 31, 2024
3be2365
Consolidate names again
nickrobinson251 Oct 31, 2024
f8a0185
Update CPU time on finish before setting task done
nickrobinson251 Oct 31, 2024
8475671
Remove TODO comment
nickrobinson251 Oct 31, 2024
bdfff79
Add new functions to docs
nickrobinson251 Oct 31, 2024
51ca0cb
fixup! Add new functions to docs
nickrobinson251 Oct 31, 2024
6bf9aa9
Return `UInt64` instead of `Int`
kpamnany Nov 8, 2024
8fbe1ff
Always return a `UInt64` type (even when returning 0)
kpamnany Nov 8, 2024
4be17af
Convert task timestamps to UInt32 delta-times since system boot.
NHDaly Nov 20, 2024
8d1cde7
Update base/task.jl
NHDaly Nov 20, 2024
f817369
Revert "Convert task timestamps to UInt32 delta-times since system bo…
NHDaly Nov 20, 2024
36f85f3
Try adding `alignas(8)` to force correct alignment and work around GC…
NHDaly Nov 21, 2024
6871b73
Revert "Try adding `alignas(8)` to force correct alignment and work a…
kpamnany Dec 3, 2024
788f46f
Reorder task structure and add padding
kpamnany Dec 4, 2024
e02c830
More changes of `task_cpu_time_ns` to `task_running_time_ns`
kpamnany Dec 4, 2024
18ee519
Move calls to `record_running_time!`
kpamnany Dec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Always return a UInt64 type (even when returning 0)
  • Loading branch information
kpamnany committed Dec 4, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 8fbe1ffab1a7224e24394335c3c135ad20ad7fbd
2 changes: 1 addition & 1 deletion base/experimental.jl
Original file line number Diff line number Diff line change
@@ -571,7 +571,7 @@ See [`Base.Experimental.task_metrics`](@ref).
function task_wall_time_ns(t::Task=current_task())
t.metrics_enabled || return nothing
start_at = t.first_enqueued_at
start_at == 0 && return 0
start_at == 0 && return UInt64(0)
end_at = t.finished_at
end_at == 0 && return time_ns() - start_at
return end_at - start_at