Skip to content

Conversation

@jorgee
Copy link
Contributor

@jorgee jorgee commented Dec 19, 2025

This pull request introduces support for tracking and reporting the use of hardware accelerators (such as GPUs) in Fusion-enabled Nextflow tasks. The changes add a new transient accelerator field to the TraceRecord, ensure this field is populated by parsing Fusion logs, and propagate this information to Tower reporting. Comprehensive tests are included to validate the new functionality.

Fusion accelerator tracking and reporting:

  • Added a transient accelerator field to the TraceRecord class, along with getter, setter, and a method (parseFusionAccelerator) to parse the accelerator usage from Fusion log files. The parsing logic checks for the FUSION_GPU_USED=true|false line in the log. ([[1]](https://github.com/nextflow-io/nextflow/pull/6677/files#diff-9c0cf79e841529211bb8765c37a7c63a11841f9b9294bd0e36982d21b10a9793R125), [[2]](https://github.com/nextflow-io/nextflow/pull/6677/files#diff-9c0cf79e841529211bb8765c37a7c63a11841f9b9294bd0e36982d21b10a9793R631-R674))
  • Modified TaskHandler to invoke parseFusionAccelerator on the .command.log file when Fusion is enabled, ensuring the accelerator field is set during task record creation. ([modules/nextflow/src/main/groovy/nextflow/processor/TaskHandler.groovyR256-R258](https://github.com/nextflow-io/nextflow/pull/6677/files#diff-cc608a283b4ad19f97e1926e7b4e60347d59fa544285e1200893893d990e13a3R256-R258))
  • Updated the TowerClient to include the accelerator value when creating the task map for reporting to Tower. ([plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovyR664](https://github.com/nextflow-io/nextflow/pull/6677/files#diff-4e7968503d8e56d6d5f2eff04e734382b6b79fee49dc22668d9a3803c91113e2R664))

Testing and validation:

  • Added unit tests in TraceRecordTest to verify correct management, parsing, and (non-)serialization of the accelerator field, including various edge cases for log file content. ([modules/nextflow/src/test/groovy/nextflow/trace/TraceRecordTest.groovyR372-R445](https://github.com/nextflow-io/nextflow/pull/6677/files#diff-a0fd6cbe04bc7f51d64dfd2475161fe33dc5a65b163dcee567e29022ef27e18bR372-R445))
  • Added a test in TowerClientTest to ensure the accelerator field is included in the Tower task map. ([plugins/nf-tower/src/test/io/seqera/tower/plugin/TowerClientTest.groovyR563-R587](https://github.com/nextflow-io/nextflow/pull/6677/files#diff-463f0ed6e146304ec6d2d8252af59dc42ba32ef8851ae68c371708e3823157c3R563-R587))

Imports and dependencies:

  • Added necessary imports for Fusion and session handling in TaskHandler.groovy. ([modules/nextflow/src/main/groovy/nextflow/processor/TaskHandler.groovyR19-R22](https://github.com/nextflow-io/nextflow/pull/6677/files#diff-cc608a283b4ad19f97e1926e7b4e60347d59fa544285e1200893893d990e13a3R19-R22))

Signed-off-by: jorgee <jorge.ejarque@seqera.io>
@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 1b67347
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/695e4f0371d8a00008a14633

Signed-off-by: jorgee <jorge.ejarque@seqera.io>
}
// If Fusion is enabled read parse the use of accelerator form .command.log
if( Global.session && FusionHelper.isFusionEnabled(Global.session as Session) )
record.parseFusionAccelerator(task.workDir?.resolve(TaskRun.CMD_LOG))
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't sound great parsing a log file to determine this capability

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, but this is how Fusion currently provides the GPU metric. This is why I keep it as draft.

@bentsherman
Copy link
Member

@jorgee can you make separate PRs for the accelerator request vs GPU metrics? I mainly wanted to get the accelerator request added because it should be trivial

@jorgee
Copy link
Contributor Author

jorgee commented Jan 5, 2026

By accelerator request, do you mean the accelerator directive defined in the process?

@bentsherman
Copy link
Member

Yes. The request is separate from the usage

@jorgee jorgee changed the title Add accelerator field in trace record Add accelerator usage field in trace record Jan 7, 2026
Signed-off-by: jorgee <jorge.ejarque@seqera.io>
@jorgee
Copy link
Contributor Author

jorgee commented Jan 7, 2026

I have created #6703 to include the accelerator request in the trace record and pass it to Platform. I have also modified this PR to set the acceleratorUsage field instead of just accelerator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants