Runtime: the completion thread waits for a piece that carries nothing to retire; three tests at the device's room
A cut command buffer's pieces before its last are submissions with no command buffer, upload or copy-in to retire, so the completion thread, which waits only for what it retires, never saw them complete: the device's room stayed taken and a command buffer of more pieces than the room holds never went on (every pieces test and every test with a command buffer cut into four or more pieces timed out on lavapipe, the RX 7900 XTX and the Iris Xe: jobs m3-max-68356, m3-max-68359, m3-max-68360). Done::submitted now keeps a marker (Item::Piece) for a submission that carries nothing else, so its completion raises the completed value and wakes the submit thread. Forced by the failing tests: +14 product lines (complete.rs). Tests: - private_arena's barrier helper sets each kernel's rate to 1 ps a threadgroup first, the test's own input, so its dispatches share one piece and the barriers counted are the dispatches' own (its first command buffer with the arena kernel, of unknown rate, was cut twice, two end barriers more: 4 against 2 on the XTX and the Iris). Its assertions are unchanged. - every_device_submits_a_shared_event_chain_across_two_queues_before_its_first_link_runs: an "at once" become "when the device has room". Old: five links on two queues, each queue having room for its own, all Scheduled before the first runs. New: three links (IN_FLIGHT), the device's room, all Scheduled before the first runs; a fourth would be held for room and a fifth for the fourth's signal. The completion order and the words assertions are unchanged. - every_device_schedules_a_wait_for_an_event_s_value_as_it_is_submitted: each queue's expected run is set to 1 ms, the test's own input, so the device has room for the signaller, the waiter and the next at once; with runs unknown the device takes two. Its assertions are unchanged.
This commit is contained in:
1 parent
544f21b48f
commit
c9c53b85cf
3 files changed
+27
-2
No files matched your search
@@ -99,6 +99,9 @@ enum Item {
|
||||
Upload(Upload),
|
||||
/// A Managed buffer's copy-in the submission took (`crate::capture`).
|
||||
CopyIn(CopyIn),
|
||||
/// A submission that carries nothing to retire, a piece before its command buffer's last
|
||||
/// (`crate::piece`): its completion leaves the device room for the next (`crate::submit`).
|
||||
Piece,
|
||||
}
|
||||
|
||||
impl Done {
|
||||
@@ -243,6 +246,7 @@ impl Done {
|
||||
Item::Command { .. } => "a command buffer",
|
||||
Item::Upload(_) => "an upload",
|
||||
Item::CopyIn(_) => "a copy-in",
|
||||
Item::Piece => "a piece",
|
||||
};
|
||||
let reached = match reached_by_wait(device, self.progress, oldest.value) {
|
||||
Ok(reached) => reached.to_string(),
|
||||
@@ -353,6 +357,14 @@ impl Done {
|
||||
},
|
||||
});
|
||||
}
|
||||
if state.flight.back().is_none_or(|last| last.value != value) {
|
||||
state.flight.push_back(Retiree {
|
||||
value,
|
||||
held,
|
||||
lost: false,
|
||||
item: Item::Piece,
|
||||
});
|
||||
}
|
||||
state.watched.extend(watch);
|
||||
self.wake(&mut state, &core.device, flight_only);
|
||||
}
|
||||
@@ -436,6 +448,7 @@ impl Retiree {
|
||||
Item::Command { .. } => "a command buffer",
|
||||
Item::Upload(_) => "an upload",
|
||||
Item::CopyIn(_) => "a copy-in",
|
||||
Item::Piece => "a piece",
|
||||
},
|
||||
self.value,
|
||||
if self.lost { ", lost" } else { "" }
|
||||
@@ -457,6 +470,7 @@ impl Retiree {
|
||||
}
|
||||
Item::Upload(upload) => upload.retire(core, end),
|
||||
Item::CopyIn(copy_in) => copy_in.retire(core, end),
|
||||
Item::Piece => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1039,6 +1039,12 @@ pub(crate) mod on_device {
|
||||
arena.buffer(),
|
||||
);
|
||||
let (queue, signaller_queue) = (queue(&device), self::queue(&device));
|
||||
// Each queue's expected run 1 ms, the test's own input, so the device has room for the
|
||||
// three submissions at once (`submit::room`).
|
||||
for queue in [&queue, &signaller_queue] {
|
||||
let probe = queue.command_buffer().expect("a command buffer");
|
||||
probe.queue().set_run_for_test(BODY_RUN);
|
||||
}
|
||||
let log = Log::default();
|
||||
let submitted = |command_buffer: &CommandBuffer| {
|
||||
let before = device.counters().metrics().submissions;
|
||||
@@ -1119,7 +1125,7 @@ pub(crate) mod on_device {
|
||||
/// Links of a chain on two queues, each but the first waiting for the shared event's value the
|
||||
/// link before it signals, then copying the words of every link before it from that link's
|
||||
/// buffer, writing its own after them, and signalling the next, all behind busy work: each
|
||||
/// queue's expected run 1 ms, so each has room for its links (`submit::room`), every link goes
|
||||
/// queue's expected run 1 ms, so the device has room for the three links (`submit::room`), every link goes
|
||||
/// to the driver and reads `Scheduled`, its scheduled handler run, before the first has run,
|
||||
/// and the submit thread holds none of them for a value. No semaphore wait is
|
||||
/// submitted for a link: once the busy work ends, the links complete in order, and each holds
|
||||
@@ -1132,7 +1138,7 @@ pub(crate) mod on_device {
|
||||
/// held.
|
||||
#[test]
|
||||
fn every_device_submits_a_shared_event_chain_across_two_queues_before_its_first_link_runs() {
|
||||
const LINKS: u32 = 5;
|
||||
const LINKS: u32 = IN_FLIGHT as u32;
|
||||
each_device("event_chain", |name, _, device| {
|
||||
let mut arena = Arena::new(&device);
|
||||
let buffers: Vec<Buffer> = (0..=LINKS).map(|_| arena.buffer()).collect();
|
||||
|
||||
@@ -134,6 +134,11 @@ entry:
|
||||
kernels: &[&ComputePipelineState],
|
||||
outs: &[Buffer],
|
||||
) -> (u64, crate::Metrics) {
|
||||
// Each kernel's rate 1 ps a threadgroup, the test's own input, so the dispatches share one
|
||||
// piece (`crate::piece`) and the barriers counted are the dispatches' own.
|
||||
for kernel in kernels {
|
||||
kernel.inner.compiled.rate.set_for_test(1);
|
||||
}
|
||||
let counters = device.counters();
|
||||
let before = counters.metrics();
|
||||
let queue = device.new_command_queue(1).expect("a queue");
|
||||
|
||||
Reference in new issue
Block a user