Skip to content

Add manual tip-position chunking for NumPy and PyTorch dI/dV backends - #80

Closed
GianmarcoMidena wants to merge 9 commits into
masterfrom
70-manually-scale-numpypytorch-didv-backends-for-high-stress-workloads
Closed

Add manual tip-position chunking for NumPy and PyTorch dI/dV backends#80
GianmarcoMidena wants to merge 9 commits into
masterfrom
70-manually-scale-numpypytorch-didv-backends-for-high-stress-workloads

Conversation

@GianmarcoMidena

Copy link
Copy Markdown
Contributor

Description

Adds manual tip-position chunking to the vectorized dI/dV implementations so that high-stress NumPy and PyTorch workloads can trade runtime for lower peak memory use.

Changes

  • Adds n_tip_position_chunks support through:
    • ProbeSTM.dIdV
    • ProbeSTM.STM
    • ProbeSTM.MSTM
    • STMutils.run_stm_scan
    • NumPy and PyTorch vectorized dI/dV backends
  • Refactors vectorized dI/dV evaluation to flatten tip positions, process them in configurable chunks, then reshape back to the scan output shape.
  • Adds backend-specific vertical stacking helpers for NumPy and PyTorch.
  • Expands dI/dV tests to cover default, one-chunk, and two-chunk NumPy/PyTorch paths.
  • Adds advanced.n_tip_position_chunks TOML support with a Si 7x7 NumPy chunking example.
  • Adds runtime logging setup in ppstm_run.py and debug logging around chunk progress.
  • Removes the unused global pytest backend fixture from tests/conftest.py.

Closes #70

@GianmarcoMidena
GianmarcoMidena force-pushed the 70-manually-scale-numpypytorch-didv-backends-for-high-stress-workloads branch from 181085d to 5068e61 Compare August 25, 2026 14:49

from pyPPSTM.probe_stm_vectorized import ProbeStmVectorized, ProbeStmVectorizedSp, ProbeStmVectorizedSpd

DeviceLikeType: TypeAlias = str | torch.device | int

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 this can be removed?

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.

My IDE accidentally included that statement in one of the previous commits.

@GianmarcoMidena

Copy link
Copy Markdown
Contributor Author

Closed to stack #83 and #84

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.

2 participants