Skip to content

add support for rubik npu metrics#2517

Draft
samfreund wants to merge 1 commit into
PhotonVision:mainfrom
samfreund:rubik-npu-metrics
Draft

add support for rubik npu metrics#2517
samfreund wants to merge 1 commit into
PhotonVision:mainfrom
samfreund:rubik-npu-metrics

Conversation

@samfreund

@samfreund samfreund commented Jun 19, 2026

Copy link
Copy Markdown
Member

Description

This PR adds support for NPU metrics on the Rubik Pi 3 like the ones we have on the orange pi. The metrics that we get from the rubik are different than the opi, so we now pass NPU usage as a map of strings that get displayed in the frontend. On the rubik pi there's a daemon that writes usage to a file using a key=value system, we simply read that and send to the frontend.

Blocked by PhotonVision/photon-image-modifier#146

Meta

Merge checklist:

  • Pull Request title is short, imperative summary of proposed changes
  • The description documents the what and why, including events that led to this PR
  • If this PR changes behavior or adds a feature, user documentation is updated
  • If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly
  • If this PR touches configuration, this is backwards compatible with all settings going back to the previous seasons's last release (seasons end after champs ends)
  • If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated
  • If this PR addresses a bug, a regression test for it is added
  • If this PR adds a dependency, the license has been checked for compatibility and steps taken to follow it

@samfreund samfreund requested a review from a team as a code owner June 19, 2026 05:03
@github-actions github-actions Bot added frontend Having to do with PhotonClient and its related items backend Things relating to photon-core and photon-server labels Jun 19, 2026
const npuUsage =
data.npuUsage instanceof Map
? new Map(data.npuUsage)
: new Map(Object.entries(data.npuUsage as Record<string, number>));

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.

Why do we need to deal with both cases here?


@Override
public double[] getNpuUsage() {
public Map<String, Double> getNpuUsage() {

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.

Does a more strongly typed data structure make more sense than a Map here?

@samfreund samfreund marked this pull request as draft June 23, 2026 05:33
@spacey-sooty

Copy link
Copy Markdown
Member

Some screenshots to see what it looks like would be nice btw.

@samfreund samfreund force-pushed the rubik-npu-metrics branch from 04d62df to 2b0a20c Compare June 24, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Things relating to photon-core and photon-server frontend Having to do with PhotonClient and its related items

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants