Skip to content

Log Slurm topology node lists as a single nodes_csv column (#177) - #177

Merged
mitthu merged 1 commit into
facebookresearch:mainfrom
mitthu:export-D118152543
Aug 31, 2026
Merged

Log Slurm topology node lists as a single nodes_csv column (#177)#177
mitthu merged 1 commit into
facebookresearch:mainfrom
mitthu:export-D118152543

Conversation

@mitthu

@mitthu mitthu commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary:

ScontrolTopology.Nodes was a list[str], and the sinks flatten list fields
into one indexed attribute per element (flatten_dict_factory in
monitoring/dataclass_utils.py, used by exporters/otel.py). In Scuba that
turned a single node list into 1182 separate Normals columns, Nodes.0
through Nodes.1181, with a new column minted every time a switch grows.

Differential Revision: D118152543

@meta-codesync

meta-codesync Bot commented Aug 31, 2026

Copy link
Copy Markdown

@mitthu has exported this pull request. If you are a Meta employee, you can view the originating Diff in D118152543.

@github-actions

Copy link
Copy Markdown

CI Commands

The following CI workflows run automatically on every push and pull request:

Workflow What it runs
GPU Cluster Monitoring Python CI lint, tests, typecheck, format, deb build, pyoxidizer builds
Go packages CI shelper tests, format, lint

The following commands can be used by maintainers to trigger additional tests that require access to secrets:

Command Description Requires approval?
/metaci tests Runs Meta internal integration tests (pytest) Yes — a maintainer must trigger the command and approve the deployment request
/metaci integration tests Same as above (alias) Yes

Note: Only repository maintainers (OWNER association) can trigger /metaci commands. After commenting the command, a maintainer must also navigate to the Actions tab and approve the deployment to the graph-api-access environment before the jobs will run. See the approval guidelines for what to approve or reject.

@luccabb luccabb 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.

this is good, we should maybe patch creation at some point: https://github.com/facebookresearch/gcm/blob/main/gcm/monitoring/dataclass_utils.py#L103

Comment thread gcm/schemas/slurm/scontrol_topology.py Outdated
Comment on lines +30 to +32
# Comma-separated form of `Nodes`. Sinks flatten list fields into one
# indexed column per element (`Nodes.0`, `Nodes.1`, ...), which makes the
# node list unusable as a single value in Scuba. This keeps it queryable.

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.

Suggested change
# Comma-separated form of `Nodes`. Sinks flatten list fields into one
# indexed column per element (`Nodes.0`, `Nodes.1`, ...), which makes the
# node list unusable as a single value in Scuba. This keeps it queryable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated to just flatten the source list instead of adding the nodes_csv column.

@mitthu
mitthu requested review from Yash0270 and xman1979 August 31, 2026 18:43
@meta-codesync meta-codesync Bot changed the title Log Slurm topology node lists as a single nodes_csv column Log Slurm topology node lists as a single nodes_csv column (#177) Aug 31, 2026
mitthu added a commit to mitthu/gcm that referenced this pull request Aug 31, 2026
…kresearch#177)

Summary:

`ScontrolTopology.Nodes` is a `list[str]`, and the sinks flatten list fields
into one indexed attribute per element (`flatten_dict_factory` in
`monitoring/dataclass_utils.py`, used by `exporters/otel.py`). In Scuba that
turns a single node list into 1182 separate `Normals` columns, `Nodes.0`
through `Nodes.1181` — with no array left to `IMPLODE`, and a new column
minted every time a switch grows.

Getting the node list back as one value today requires a derived column that
enumerates every index:

```
IMPLODE(',', REGEXP_REMOVE_ARRAY(ARRAY(`Nodes.0`, ..., `Nodes.1181`), '^$'))
```

That is ~15KB of SQL, reads 1182 columns per row, and silently truncates the
moment a node list outgrows the highest column that exists.

This adds a `nodes_csv` field alongside `Nodes` holding the comma-joined list,
which lands as a single `Normals` column — groupable and filterable with
`substr`/regex, no derived column needed. `Nodes` is kept as-is so the
per-element columns remain available and ordering is preserved (a tagset would
dedupe and reorder, which would break the topology-aware job debugging use
case in T275974051).

Empty node lists (e.g. `SwitchName=data-transfer Nodes=`) leave `nodes_csv`
unset rather than emitting an empty string, matching how the other optional
fields behave.

Differential Revision: D118152543
@mitthu
mitthu force-pushed the export-D118152543 branch from 852830c to 2332832 Compare August 31, 2026 19:07
…kresearch#177)

Summary:

`ScontrolTopology.Nodes` is a `list[str]`, and the sinks flatten list fields
into one indexed attribute per element (`flatten_dict_factory` in
`monitoring/dataclass_utils.py`, used by `exporters/otel.py`). In Scuba that
turns a single node list into 1182 separate `Normals` columns, `Nodes.0`
through `Nodes.1181` — with no array left to `IMPLODE`, and a new column
minted every time a switch grows.

Getting the node list back as one value today requires a derived column that
enumerates every index:

```
IMPLODE(',', REGEXP_REMOVE_ARRAY(ARRAY(`Nodes.0`, ..., `Nodes.1181`), '^$'))
```

That is ~15KB of SQL, reads 1182 columns per row, and silently truncates the
moment a node list outgrows the highest column that exists.

This adds a `nodes_csv` field alongside `Nodes` holding the comma-joined list,
which lands as a single `Normals` column — groupable and filterable with
`substr`/regex, no derived column needed. `Nodes` is kept as-is so the
per-element columns remain available and ordering is preserved (a tagset would
dedupe and reorder, which would break the topology-aware job debugging use
case in T275974051).

Empty node lists (e.g. `SwitchName=data-transfer Nodes=`) leave `nodes_csv`
unset rather than emitting an empty string, matching how the other optional
fields behave.

Differential Revision: D118152543
@mitthu
mitthu force-pushed the export-D118152543 branch from 2332832 to 462a773 Compare August 31, 2026 19:13
@mitthu
mitthu merged commit 8273cfd into facebookresearch:main Aug 31, 2026
41 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants