Skip to content

[REFACTOR] Rework ChemGraph installation #146

Description

@tdpham2

Make MLIP dependencies optional for HPC compatibility

Problem

ChemGraph currently includes MLIP packages (MACE) in pyproject.toml. This works for local installations, where pip can manage the PyTorch version and related dependencies.

However, this causes problems on HPC systems, particularly Aurora. On Aurora, users must load the system-provided PyTorch environment through:

module load frameworks

This PyTorch build is configured for Intel GPU/XPU support. Installing MACE, FairChem, or ChemGraph through pip may replace or conflict with the system-provided PyTorch version. As a result, the MLIP packages may only work on CPUs or may fail due to incompatible dependencies.

This is likely a broader issue across HPC systems, where PyTorch builds are selected and optimized for specific hardware and software environments.

Proposed direction

Keep the core ChemGraph installation lightweight:

  • Remove MACE, FairChem, and other MLIP packages from the required dependencies.
  • Retain TBLite/xTB as the default lightweight computational backend for demonstrations and basic testing.
  • Provide MLIP integrations as optional dependencies. Local deployment can still install these dependencies.
  • Recommend that HPC users configure the appropriate PyTorch environment and install the desired MLIP packages separately before installing ChemGraph.

For example, the recommended installation order on an HPC system could be:

  1. Load the system-provided PyTorch environment.
  2. Install MACE, FairChem, or other required MLIP packages in a compatible environment.
  3. Install ChemGraph without modifying the existing PyTorch installation.

Possible dependency structure

[project.optional-dependencies]
mace = [
    "mace-torch",
]

fairchem = [
    "fairchem-core",
]

mlips = [
    "mace-torch",
    "fairchem-core",
]

We should also ensure that ChemGraph imports these packages only when the corresponding tools are used and provides a clear error message when an optional dependency is unavailable.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions