Performance problem with multi head training

Open
#47 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Quiet
Tech stack
python

Research direction

The issue names no source files or tests. Start by profiling multi-head training with a small FeNNol-like model using three heads, and compare the work performed inside the jax.jit graph for each training step. Done means identifying the source of the slowdown and confirming improved training performance without repeatedly calculating unused heads.

Written by the indexing model from the issue text.

Description

Because the graph used by jax.jit is static, it will repeatedly calculate all heads during each step, resulting in significant waste, which is particularly obvious when training many heads. We use almost the same multi head implementation as MLIPv2 on a small FeNNol model with 3 heads, it slows down the training speed by 20%. One solution may be to ensure that each step has only one head and select only the corresponding parameter outside the jitted function.

This is a reminder while I have not studied this issue on MLIPv2 in detail. I will conduct performance analysis and write codes when available.

Dominant language
Python
Stars
149
Forks
24
PR merge metrics
No merged PRs in 30d

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from instadeepai/mlip

All issues in instadeepai/mlip

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.