Spaces:
Sleeping
Sleeping
Download src/lib/linkedFocus.ts from joeddav/illustrated-cluster: direct link, hf CLI and curl.
- Browser
- Download file 671 Bytes
-
https://huggingface.co/spaces/joeddav/illustrated-cluster/resolve/main/src/lib/linkedFocus.ts
- Command line
-
hf download hf://spaces/joeddav/illustrated-cluster/src/lib/linkedFocus.ts
-
curl -L -o linkedFocus.ts https://huggingface.co/spaces/joeddav/illustrated-cluster/resolve/main/src/lib/linkedFocus.ts
671 Bytes
| export type LinkedFocus = { | |
| source: 'transformer' | |
| label: string | |
| stage: number | null | |
| tpLane: number | null | |
| cpShard: number | null | |
| sequenceBand: number | null | |
| } | |
| type FocusableGpu = { | |
| active: boolean | |
| stage: number | |
| tpLane: number | |
| cpShard: number | |
| } | |
| export function matchesLinkedFocus(gpu: FocusableGpu, focus: LinkedFocus | null) { | |
| if (!focus || !gpu.active) { | |
| return false | |
| } | |
| if (focus.stage !== null && gpu.stage !== focus.stage) { | |
| return false | |
| } | |
| if (focus.tpLane !== null && gpu.tpLane !== focus.tpLane) { | |
| return false | |
| } | |
| if (focus.cpShard !== null && gpu.cpShard !== focus.cpShard) { | |
| return false | |
| } | |
| return true | |
| } | |