Start Times for FIFO Gang-Scheduled GPU Training Jobs
Last updated: November 29, 2026
Quick Overview
A cluster has G GPUs and a queue of fine-tuning jobs, each with a submit time, a GPU count it needs all at once, and a duration; with strict FIFO ordering, compute when each job starts.
Truefoundry
November 29, 20260
0
0 solved
A cluster has G GPUs and a queue of fine-tuning jobs, each with a submit time, a GPU count it needs all at once, and a duration; with strict FIFO ordering, compute when each job starts.
TrueFoundry runs fine-tuning and training jobs on shared GPU pools, and distributed jobs need all their GPUs at the same time. The interviewer checks event-driven simulation with a heap and whether you understand head-of-line blocking, which leads naturally into a backfill follow-up.
What the Interviewer Expects
- Model running jobs as a min-heap of end times
- Respect both submit times and FIFO order
- Release every job that has finished by the current time before checking capacity
- Reject jobs that need more GPUs than the cluster has
- O(n log n) total
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- Add backfilling: let a small job jump ahead if it cannot delay the head job.
- How would priorities and preemption change the model?
- How do you account for GPU topology, such as needing all 8 GPUs on one node?
- How would you report expected wait time to a user in the UI?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Jobs are given in queue order as (submit, gpus, duration). A job starts at the earliest time that is at least its submit time, at least the previous job's start time, and at which gpus GPUs are fr...
High-Level Design
Keep a time cursor t, a free GPU count, and a min-heap of (end_time, gpus) for running jobs. For each job, advance t to its submit time, free anything that has ended, and while capacity is short...