Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lightning Refactor: pytorch_lightning -> lightning.pytorch #300

Merged
merged 5 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions Security.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Security Policy
Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation.
## Reporting a Vulnerability
Please report any security vulnerabilities in this project [utilizing the guidelines here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).
# Security Policy
Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation.

## Reporting a Vulnerability
Please report any security vulnerabilities in this project [utilizing the guidelines here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).
2 changes: 1 addition & 1 deletion examples/callbacks/SAM.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl

from matsciml.datasets.transforms import DistancesTransform, PointCloudToGraphTransform
from matsciml.lightning.data_utils import MatSciMLDataModule
Expand Down
4 changes: 2 additions & 2 deletions examples/callbacks/autocorrelation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import pytorch_lightning as pl
from pytorch_lightning.loggers import TensorBoardLogger, WandbLogger
import lightning.pytorch as pl
from lightning.pytorch.loggers import TensorBoardLogger, WandbLogger

from matsciml.datasets.transforms import DistancesTransform, PointCloudToGraphTransform
from matsciml.lightning.data_utils import MatSciMLDataModule
Expand Down
2 changes: 1 addition & 1 deletion examples/callbacks/code-carbon.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl

from matsciml.datasets.transforms import (
PointCloudToGraphTransform,
Expand Down
4 changes: 2 additions & 2 deletions examples/callbacks/exponential_moving_average.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import pytorch_lightning as pl
from pytorch_lightning.callbacks import StochasticWeightAveraging
import lightning.pytorch as pl
from lightning.pytorch.callbacks import StochasticWeightAveraging

from matsciml.datasets.transforms import DistancesTransform, PointCloudToGraphTransform
from matsciml.lightning.data_utils import MatSciMLDataModule
Expand Down
4 changes: 2 additions & 2 deletions examples/callbacks/helper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import pytorch_lightning as pl
from pytorch_lightning.loggers import WandbLogger
import lightning.pytorch as pl
from lightning.pytorch.loggers import WandbLogger

from matsciml.datasets.transforms import DistancesTransform, PointCloudToGraphTransform
from matsciml.lightning.data_utils import MatSciMLDataModule
Expand Down
2 changes: 1 addition & 1 deletion examples/callbacks/loss_scheduling.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl

from matsciml.datasets.transforms import (
PeriodicPropertiesTransform,
Expand Down
2 changes: 1 addition & 1 deletion examples/datasets/alexandria/single_task_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.nn import LayerNorm, SiLU

from matsciml.datasets.transforms import (
Expand Down
2 changes: 1 addition & 1 deletion examples/datasets/alexandria/single_task_devset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl

from matsciml.datasets.transforms import (
PointCloudToGraphTransform,
Expand Down
2 changes: 1 addition & 1 deletion examples/datasets/alexandria/single_task_egnn.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.nn import LayerNorm, SiLU

from matsciml.datasets.transforms import (
Expand Down
2 changes: 1 addition & 1 deletion examples/datasets/alexandria/single_task_gala.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.nn import LayerNorm, SiLU

from matsciml.lightning.data_utils import MatSciMLDataModule
Expand Down
2 changes: 1 addition & 1 deletion examples/datasets/alexandria/single_task_mpnn_dgl.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl

from matsciml.datasets.transforms import (
DistancesTransform,
Expand Down
2 changes: 1 addition & 1 deletion examples/datasets/carolina_db/single_task_devset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.nn import LayerNorm, SiLU

from matsciml.datasets.transforms import PointCloudToGraphTransform
Expand Down
2 changes: 1 addition & 1 deletion examples/datasets/colabfit/single_task_devset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.nn import LayerNorm, SiLU

from matsciml.datasets.transforms import PointCloudToGraphTransform
Expand Down
2 changes: 1 addition & 1 deletion examples/datasets/materials_project/single_task_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.nn import LayerNorm, SiLU

from matsciml.datasets.transforms import PointCloudToGraphTransform
Expand Down
2 changes: 1 addition & 1 deletion examples/datasets/materials_project/single_task_devset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl

from matsciml.datasets.transforms import PointCloudToGraphTransform
from matsciml.lightning.data_utils import MatSciMLDataModule
Expand Down
2 changes: 1 addition & 1 deletion examples/datasets/materials_project/single_task_egnn.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.nn import LayerNorm, SiLU

from matsciml.datasets.transforms import PointCloudToGraphTransform
Expand Down
2 changes: 1 addition & 1 deletion examples/datasets/materials_project/single_task_gala.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.nn import LayerNorm, SiLU

from matsciml.lightning.data_utils import MatSciMLDataModule
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.nn import LayerNorm, SiLU

from matsciml.datasets.transforms import PointCloudToGraphTransform
Expand Down
2 changes: 1 addition & 1 deletion examples/datasets/nomad/single_task_devset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.nn import LayerNorm, SiLU

from matsciml.datasets.transforms import (
Expand Down
2 changes: 1 addition & 1 deletion examples/datasets/oqmd/single_task_devset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.nn import LayerNorm, SiLU

from matsciml.datasets.transforms import (
Expand Down
2 changes: 1 addition & 1 deletion examples/devices/xpu_ddp_mpi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations


import pytorch_lightning as pl
import lightning.pytorch as pl
from torch import nn
from torch import distributed as dist
from mace.modules import RealAgnosticInteractionBlock
Expand Down
2 changes: 1 addition & 1 deletion examples/devices/xpu_ddp_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os

import pytorch_lightning as pl
import lightning.pytorch as pl
from matsciml.datasets.transforms import (
PointCloudToGraphTransform,
PeriodicPropertiesTransform,
Expand Down
2 changes: 1 addition & 1 deletion examples/devices/xpu_example.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl

from matsciml.datasets.transforms import PointCloudToGraphTransform
from matsciml.lightning.data_utils import MatSciMLDataModule
Expand Down
2 changes: 1 addition & 1 deletion examples/interfaces/ase_from_scratch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from ase import Atoms, units
from ase.md.verlet import VelocityVerlet
import pytorch_lightning as pl
import lightning.pytorch as pl

from matsciml.lightning import MatSciMLDataModule
from matsciml.models.base import ForceRegressionTask
Expand Down
2 changes: 1 addition & 1 deletion examples/leaderboard_format_example.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl

from matsciml.lightning.callbacks import LeaderboardWriter
from matsciml.lightning.data_utils import IS2REDGLDataModule, is2re_devset
Expand Down
2 changes: 1 addition & 1 deletion examples/model_demos/cdvae/cdvae.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys
from pathlib import Path

import pytorch_lightning as pl
import lightning.pytorch as pl
import torch
from tqdm import tqdm

Expand Down
2 changes: 0 additions & 2 deletions examples/model_demos/cdvae/cdvae_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
import os
import sys
import time
from functools import partial
from pathlib import Path
from types import SimpleNamespace

import pytorch_lightning as pl
import torch
from torch.optim import Adam
from torch_geometric.data import Batch
Expand Down
3 changes: 0 additions & 3 deletions examples/model_demos/cdvae/cdvae_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
import os
import sys
from collections import Counter
from functools import partial
from pathlib import Path

import numpy as np
import pytorch_lightning as pl
from matminer.featurizers.composition.composite import ElementProperty
from matminer.featurizers.site.fingerprint import CrystalNNFingerprint
from p_tqdm import p_map
Expand Down Expand Up @@ -39,7 +37,6 @@
compute_cov,
get_crystals_list,
get_fp_pdist,
load_config,
load_data,
prop_model_eval,
smact_validity,
Expand Down
4 changes: 2 additions & 2 deletions examples/model_demos/egnn_pyg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl

from matsciml.datasets.transforms import PointCloudToGraphTransform
from matsciml.lightning.data_utils import MatSciMLDataModule
Expand Down Expand Up @@ -33,5 +33,5 @@
)

# run a quick training loop
trainer = pl.Trainer(fast_dev_run=10)
trainer = pl.Trainer(fast_dev_run=10, accelerator="cpu")
trainer.fit(task, datamodule=dm)
6 changes: 3 additions & 3 deletions examples/model_demos/faenet_pyg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl

from matsciml.datasets.transforms import (
FrameAveraging,
Expand All @@ -25,7 +25,7 @@
"out_dim": 128,
"tag_hidden_channels": 0,
},
output_kwargs={"lazy": False, "input_dim": 128, "hidden_dim": 128},
output_kwargs={"lazy": False, "input_dim": 128, "hidden_dim": 128},
task_keys=["force"],
)

Expand All @@ -47,4 +47,4 @@

# run a quick training loop
trainer = pl.Trainer(fast_dev_run=10)
trainer.fit(task, datamodule=dm)
trainer.fit(task, datamodule=dm)
2 changes: 1 addition & 1 deletion examples/model_demos/m3gnet_dgl.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl

from matsciml.datasets.utils import element_types
from matsciml.lightning.data_utils import MatSciMLDataModule
Expand Down
Loading
Loading