Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
caeb7f0
prototype ET Rnl
cortner Nov 18, 2025
c468196
Merge branch 'dev-0.10' into co/etback
cortner Nov 19, 2025
291f384
start ET ace model prototype
cortner Nov 23, 2025
76e27b7
simple test improvements
cortner Nov 26, 2025
e5e8a6a
integrate Rnl -> ET + improved tests
cortner Nov 29, 2025
350001b
fixed the energy test in new_backend
cortner Nov 29, 2025
5bf14b7
first complete Lux-style linear ace model draft
cortner Nov 29, 2025
c29a063
converted the transforms to new ET implementation
cortner Dec 4, 2025
bc3a76f
towards finding the Rnl bug
cortner Dec 4, 2025
46b4175
Rnl now evaluates on the GPU
cortner Dec 5, 2025
ffe87d1
first fully working GPU evaluation of E
cortner Dec 10, 2025
70e16ad
Merge branch 'main' into co/etback
cortner Dec 10, 2025
109efc8
update version bounds
cortner Dec 18, 2025
86adc37
checkpoint new rbasis construction
cortner Dec 19, 2025
73e1109
new backend now mostly up to date again
cortner Dec 19, 2025
f973935
Zygote.gradient evaluates (correctness tests missing)
cortner Dec 19, 2025
a9a70ef
prototype ETACE living inside ACEpotentials
cortner Dec 19, 2025
7b23831
some test cleanup
cortner Dec 19, 2025
74ec7e8
site gradients, basis and jacobians draft
cortner Dec 19, 2025
fc78b79
remove ET path
cortner Dec 19, 2025
5233ba0
derivative correctness tests
cortner Dec 20, 2025
8cf42c6
some gpu bugfixes
cortner Dec 20, 2025
c794258
steps towards GPU gradients
cortner Dec 21, 2025
1429040
gpu gradient tests pass
cortner Dec 21, 2025
ce24dcb
update versioning
cortner Dec 23, 2025
7434d61
bring back 1.12 ediff test
cortner Dec 23, 2025
5a03f91
general cleanup, slim down et tests
cortner Dec 23, 2025
057d8c2
fix ET path
cortner Dec 23, 2025
c9ec04c
fix and test GPU evaluation of basis jacobian
cortner Dec 26, 2025
5351bc2
draft one-body
cortner Dec 26, 2025
5689a21
most tests + bugfixes
cortner Dec 27, 2025
fc65622
finish et onebody tests, gpu
cortner Dec 27, 2025
cc12b4c
up version bound for DP due to DP#14
cortner Dec 27, 2025
d3872eb
fix tests
cortner Dec 27, 2025
a4897ae
draft pair potential model
cortner Dec 27, 2025
86163ad
Merge branch 'E0s' into co/etpair
cortner Dec 27, 2025
4277cc8
Merge pull request #315 from ACEsuit/E0s
cortner Dec 27, 2025
a7feef6
add new model to include
cortner Dec 27, 2025
ccf593e
Merge branch 'co/etback' into co/etpair
cortner Dec 27, 2025
4b6ed0f
draft pair tests
cortner Dec 28, 2025
85165b7
debugging pairbasis conversion
cortner Dec 28, 2025
f52e0b8
more debugging
cortner Dec 28, 2025
560bb5b
test: match pair pot
cortner Dec 28, 2025
9b84abd
full draft pair model, tests passing
cortner Dec 29, 2025
eb97c4c
test cleanup
cortner Dec 29, 2025
79e86b4
move pair model converstion to convert.jl
cortner Dec 29, 2025
efa4d48
finalize tests
cortner Dec 29, 2025
eb435dd
Merge pull request #316 from ACEsuit/co/etpair
cortner Dec 29, 2025
69dc4cd
some draft spline code
cortner Dec 30, 2025
37fb93f
first passing spline test
cortner Dec 30, 2025
44c2d7e
move spline implementation to ET
cortner Dec 30, 2025
fca4771
tests for spline derivatives
cortner Dec 30, 2025
b9de171
splinification of pair model + tests
cortner Dec 30, 2025
0527899
rename -> test_etace
cortner Dec 30, 2025
30ae6a7
prototype splinification of ETACE
cortner Dec 31, 2025
f3ab005
all spline tests except gpu
cortner Dec 31, 2025
7589eaa
adjust splines code to ET 0.4.3
cortner Jan 1, 2026
4a33693
cleanuo
cortner Jan 1, 2026
c6325e3
Merge pull request #317 from ACEsuit/co/splines
cortner Jan 1, 2026
8634c78
Phase 1: ETACEPotential with AtomsCalculators interface
jameskermode Dec 23, 2025
ccf925a
Phase 2: SiteEnergyModel interface and StackedCalculator
jameskermode Dec 23, 2025
657500a
Refactor StackedCalculator to separate file
jameskermode Dec 23, 2025
07b3641
Phase 5: Training assembly functions for ETACEPotential
jameskermode Dec 23, 2025
e4c661f
Optimize StackedCalculator with @generated functions
jameskermode Dec 23, 2025
5da6c25
Add benchmark scripts for ACE vs ETACE performance comparison
jameskermode Dec 23, 2025
2650538
Update plan with implementation progress and benchmark results
jameskermode Dec 23, 2025
d3b9c0c
Extend training assembly tests and add ACEfit integration
jameskermode Dec 23, 2025
e81a708
Add ETModels to docs and ETACE silicon integration test
jameskermode Dec 23, 2025
f3519ff
Optimize energy_forces_virial_basis with pre-allocation
jameskermode Dec 23, 2025
99f2d98
Fix ETACE integration test: compare many-body only
jameskermode Dec 23, 2025
c64168b
Refactor et_calculators.jl and stackedcalc.jl to reduce duplication
jameskermode Dec 24, 2025
40bf060
Unify ETACEPotential as type alias for WrappedSiteCalculator
jameskermode Dec 24, 2025
491b7ba
Update development plan: unified architecture (remove E0Model)
jameskermode Dec 30, 2025
389fdd1
Refactor to unified WrappedSiteCalculator (Phase 6.1-6.3)
jameskermode Dec 30, 2025
feff6a6
Add convert2et_full and parameter copying utilities (Phase 6.4-6.5)
jameskermode Dec 30, 2025
16f5ce3
Update tests for unified WrappedSiteCalculator (Phase 6.6)
jameskermode Dec 30, 2025
bee2636
Fix ETOneBody.site_grads to return consistent interface
jameskermode Dec 30, 2025
146cae9
Fix test suite issues: project activation and ETOneBody interface
jameskermode Dec 30, 2025
9af1174
Fix ET ACE and ET Pair test failures
jameskermode Dec 31, 2025
7e28b05
Fix parameter paths in convert2et_full and add full model benchmark
jameskermode Dec 31, 2025
e2bd3f3
Improve memory efficiency in ETPairModel site_grads
jameskermode Dec 31, 2025
41378df
Update EquivariantTensors to 0.4.2 and improve ET pair memory efficiency
jameskermode Dec 31, 2025
42d6b08
Revert et_pair.jl to Zygote-based site_grads and fix et_ace.jl API
jameskermode Dec 31, 2025
00e7c2b
Add GPU benchmark script and LuxCUDA test dependency
jameskermode Dec 31, 2025
d377f4a
Update development plan with completed status
jameskermode Dec 31, 2025
e609e24
Add training assembly support for ETPairModel and ACEfit integration
jameskermode Dec 31, 2025
e147496
Add comprehensive tests for training assembly of ETPairPotential, ETO…
jameskermode Dec 31, 2025
86f5856
Address PR #313 feedback: ET 0.4.3 compat and site_grads type stability
jameskermode Jan 1, 2026
1e22042
update plan
jameskermode Jan 2, 2026
91fd433
Address PR #313 review feedback and fix ETOneBody issues
jameskermode Jan 4, 2026
f10f833
Add ETACE models tutorial example
jameskermode Jan 5, 2026
504b995
Add ETACE tutorial to documentation
jameskermode Jan 5, 2026
4971a56
Add missing dependencies to docs/Project.toml
jameskermode Jan 5, 2026
10a6866
Fix Literate.jl inline comment parsing in ETACE tutorial
jameskermode Jan 5, 2026
d7de233
Merge pull request #313 from jameskermode/jrk/etcalculators
cortner Jan 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Bumper = "8ce10254-0962-460f-a3d8-1f77fea1446e"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
ChunkSplitters = "ae650224-84b6-46f8-82ea-d812ca08434e"
ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471"
DecoratedParticles = "023d0394-cb16-4d2d-a5c7-724bed42bbb6"
DynamicPolynomials = "7c1d4256-1411-5781-91ec-d7bc3513ac07"
EmpiricalPotentials = "38527215-9240-4c91-a638-d4250620c9e2"
EquivariantTensors = "5e107534-7145-4f8f-b06f-47a52840c895"
Expand Down Expand Up @@ -59,15 +61,17 @@ BenchmarkTools = "1.6.3"
Bumper = "0.7"
ChainRulesCore = "1"
ChunkSplitters = "3.0"
ConcreteStructs = "0.2.3"
DecoratedParticles = "0.1.3"
DynamicPolynomials = "0.6"
EmpiricalPotentials = "0.2"
EquivariantTensors = "0.3"
EquivariantTensors = "0.4.3"
ExtXYZ = "0.2.0"
Folds = "0.2"
ForwardDiff = "0.10"
Interpolations = "0.15"
JSON = "0.21"
Lux = "1.25"
ForwardDiff = "0.10, 1"
Interpolations = "0.16"
JSON = "0.21, 1"
Lux = "1.21"
LuxCore = "1"
NamedTupleTools = "0.13, 0.14"
NeighbourLists = "0.5"
Expand All @@ -76,18 +80,18 @@ Optim = "1"
Optimisers = "0.3.4, 0.4"
OrderedCollections = "1"
Polynomials4ML = "0.5"
PrettyTables = "1.3, 2.0"
PrettyTables = "1.3, 2"
Reexport = "1"
Roots = "2"
SparseArrays = "1.10"
SparseArrays = "1"
SpheriCart = "0.2"
StaticArrays = "1"
StaticPolynomials = "1"
StrideArrays = "0.1"
Unitful = "1"
WithAlloc = "0.1"
YAML = "0.4"
Zygote = "0.6, 0.7"
Zygote = "0.7"
julia = "1.11, 1.12"

[extras]
Expand Down
198 changes: 198 additions & 0 deletions benchmark/benchmark_full_model.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# Benchmark: Full model (1+2+many body) with StackedCalculator
# Compares ACE CPU vs ETACE CPU vs ETACE GPU for energy and forces

using ACEpotentials
M = ACEpotentials.Models
ETM = ACEpotentials.ETModels

import EquivariantTensors as ET
import AtomsCalculators
using StaticArrays, Lux, Random, LuxCore, LinearAlgebra
using AtomsBase, AtomsBuilder, Unitful
using BenchmarkTools
using Printf

# GPU detection
dev = identity
has_cuda = false

try
using CUDA
if CUDA.functional()
@info "Using CUDA"
CUDA.versioninfo()
global has_cuda = true
global dev = cu
else
@info "CUDA is not functional"
end
catch e
@info "Couldn't load CUDA: $e"
end

if !has_cuda
@info "No GPU available. Using CPU only."
end

rng = Random.MersenneTwister(1234)

# Build models with E0s and pair potential enabled
elements = (:Si, :O)
level = M.TotalDegree()
max_level = 8
order = 2
maxl = 4

rin0cuts = M._default_rin0cuts(elements)
rin0cuts = (x -> (rin = x.rin, r0 = x.r0, rcut = 5.5)).(rin0cuts)

# E0s for one-body
E0s = Dict(:Si => -158.54496821, :O => -2042.0330099956639)

model = M.ace_model(; elements = elements, order = order,
Ytype = :solid, level = level, max_level = max_level,
maxl = maxl, pair_maxn = max_level,
rin0cuts = rin0cuts,
init_WB = :glorot_normal, init_Wpair = :glorot_normal,
pair_learnable = true, # Keep learnable for ET conversion
E0s = E0s)

ps, st = Lux.setup(rng, model)

# Create old ACE calculator (full model with E0s and pair)
ace_calc = M.ACEPotential(model, ps, st)

# Convert to full ETACE with StackedCalculator
et_calc = ETM.convert2et_full(model, ps, st)

rcut = maximum(a.rcut for a in model.pairbasis.rin0cuts)

# Function to create system of given size
function make_system(n_repeat)
sys = AtomsBuilder.bulk(:Si, cubic=true) * n_repeat
rattle!(sys, 0.1u"Å")
AtomsBuilder.randz!(sys, [:Si => 0.5, :O => 0.5])
return sys
end

# Benchmark configurations
configs = [
(2, 2, 2), # 64 atoms
(3, 3, 2), # 144 atoms
(4, 4, 2), # 256 atoms
(4, 4, 4), # 512 atoms
(5, 5, 4), # 800 atoms
]

println()
println("=" ^ 90)
println("BENCHMARK: Full Model (1+2+many body) - ACE vs ETACE StackedCalculator")
println("=" ^ 90)
println()

# --- ENERGY BENCHMARK ---
println("### ENERGY ###")
println()

if has_cuda
println("| Atoms | Edges | ACE CPU (ms) | ETACE CPU (ms) | ETACE GPU (ms) | CPU Speedup | GPU Speedup |")
println("|-------|---------|--------------|----------------|----------------|-------------|-------------|")
else
println("| Atoms | Edges | ACE CPU (ms) | ETACE CPU (ms) | CPU Speedup |")
println("|-------|---------|--------------|----------------|-------------|")
end

for cfg in configs
sys = make_system(cfg)
natoms = length(sys)

# Count edges
G = ET.Atoms.interaction_graph(sys, rcut * u"Å")
nedges = length(G.edge_data)

# Warmup ACE
_ = AtomsCalculators.potential_energy(sys, ace_calc)

# Warmup ETACE CPU
_ = AtomsCalculators.potential_energy(sys, et_calc)

# Benchmark ACE CPU
t_ace = @belapsed AtomsCalculators.potential_energy($sys, $ace_calc) samples=5 evals=3
t_ace_ms = t_ace * 1000

# Benchmark ETACE CPU
t_etace_cpu = @belapsed AtomsCalculators.potential_energy($sys, $et_calc) samples=5 evals=3
t_etace_cpu_ms = t_etace_cpu * 1000

cpu_speedup = t_ace_ms / t_etace_cpu_ms

if has_cuda
# For GPU we need to handle the StackedCalculator with GPU-capable models
# TODO: GPU version of StackedCalculator
t_etace_gpu_ms = NaN
gpu_speedup = NaN

@printf("| %5d | %7d | %12.2f | %14.2f | %14s | %10.1fx | %10s |\n",
natoms, nedges, t_ace_ms, t_etace_cpu_ms, "N/A", cpu_speedup, "N/A")
else
@printf("| %5d | %7d | %12.2f | %14.2f | %10.1fx |\n",
natoms, nedges, t_ace_ms, t_etace_cpu_ms, cpu_speedup)
end
end

println()

# --- FORCES BENCHMARK ---
println("### FORCES ###")
println()

if has_cuda
println("| Atoms | Edges | ACE CPU (ms) | ETACE CPU (ms) | ETACE GPU (ms) | CPU Speedup | GPU Speedup |")
println("|-------|---------|--------------|----------------|----------------|-------------|-------------|")
else
println("| Atoms | Edges | ACE CPU (ms) | ETACE CPU (ms) | CPU Speedup |")
println("|-------|---------|--------------|----------------|-------------|")
end

for cfg in configs
sys = make_system(cfg)
natoms = length(sys)

# Count edges
G = ET.Atoms.interaction_graph(sys, rcut * u"Å")
nedges = length(G.edge_data)

# Warmup ACE
_ = AtomsCalculators.forces(sys, ace_calc)

# Warmup ETACE CPU
_ = AtomsCalculators.forces(sys, et_calc)

# Benchmark ACE CPU
t_ace = @belapsed AtomsCalculators.forces($sys, $ace_calc) samples=5 evals=3
t_ace_ms = t_ace * 1000

# Benchmark ETACE CPU
t_etace_cpu = @belapsed AtomsCalculators.forces($sys, $et_calc) samples=5 evals=3
t_etace_cpu_ms = t_etace_cpu * 1000

cpu_speedup = t_ace_ms / t_etace_cpu_ms

if has_cuda
t_etace_gpu_ms = NaN
gpu_speedup = NaN

@printf("| %5d | %7d | %12.2f | %14.2f | %14s | %10.1fx | %10s |\n",
natoms, nedges, t_ace_ms, t_etace_cpu_ms, "N/A", cpu_speedup, "N/A")
else
@printf("| %5d | %7d | %12.2f | %14.2f | %10.1fx |\n",
natoms, nedges, t_ace_ms, t_etace_cpu_ms, cpu_speedup)
end
end

println()
println("Notes:")
println("- ACE CPU: Original ACEpotentials model (full: E0 + pair + many-body)")
println("- ETACE CPU: StackedCalculator with ETOneBody + ETPairModel + ETACE")
println("- CPU Speedup = ACE CPU / ETACE CPU")
println("- Graph construction time included in ETACE timings")
Loading
Loading