From 41a1a401936a28ab289525ab8de0d993f1ce6c4c Mon Sep 17 00:00:00 2001 From: Joschka Birk Date: Wed, 22 May 2024 13:52:07 +0200 Subject: [PATCH 1/3] README update: mention that conda env has to be activated --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f9eb73b..6f8dd7c 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,23 @@ repository [jet-universe/particle_transformer](https://github.com/jet-universe/p The recommended (and by us tested) way of running the code is to use the provided docker image at [`jobirk/omnijet` on DockerHub](https://hub.docker.com/repository/docker/jobirk/omnijet/general). +The requirements listed in `docker/requirements.txt` are installed in the `conda` environment +of the base image, so you have to make sure that the `conda` environment is activated +when running the code. + +Thus, an interactive session can be started by running the following command: + +```shell +# on a machine with Singularity +singularity shell docker://jobirk/omnijet:latest # start a shell in the container +source /opt/conda/bin/activate # activate the conda environment in the container +# +# on a machine with Docker +docker run -it --rm jobirk/omnijet:latest bash # start a shell in the container +source /opt/conda/bin/activate # activate the conda environment in the container +``` + +where `` is the path to the root of the project on your local machine. Alternatively, you can install the requirements from the `docker/requirements.txt` file, but you'll have to add `pytorch` to the list of requirements, since this is not @@ -96,7 +113,7 @@ python scripts/create_tokenized_dataset.py --ckpt_path= Make sure to adjust the `--n_files_*` arguments to your needs, and set the env variable `JETCLASS_DIR` and `JETCLASS_DIR_TOKENIZED` in the `.env` file. -Afterwards, the tokenized dataset will be saved in if a subdirectory of the +Afterwards, the tokenized dataset will be saved in a subdirectory of the `JETCLASS_DIR_TOKENIZED` directory and can be used to train the backbone model. ### Generative training From 2f5873f302dc802ab578e63d6024e2a1bdfdb026 Mon Sep 17 00:00:00 2001 From: Joschka Birk Date: Wed, 22 May 2024 13:52:57 +0200 Subject: [PATCH 2/3] Fix import error with deprecated gpt_model_sequential.FullModel --- configs/experiment/example_experiment_generative.yaml | 1 - configs/experiment/experiment_backbone_generative.yaml | 1 - gabbro/models/backbone.py | 6 +----- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/configs/experiment/example_experiment_generative.yaml b/configs/experiment/example_experiment_generative.yaml index 00169ee..6781269 100644 --- a/configs/experiment/example_experiment_generative.yaml +++ b/configs/experiment/example_experiment_generative.yaml @@ -79,7 +79,6 @@ model: n_GPT_blocks: 3 n_heads: 8 verbosity: false - use_parallel_heads: true # --- optimizer configuration --- optimizer: _target_: torch.optim.AdamW diff --git a/configs/experiment/experiment_backbone_generative.yaml b/configs/experiment/experiment_backbone_generative.yaml index d11def4..ba24542 100644 --- a/configs/experiment/experiment_backbone_generative.yaml +++ b/configs/experiment/experiment_backbone_generative.yaml @@ -90,7 +90,6 @@ model: n_GPT_blocks: 3 n_heads: 8 verbosity: false - use_parallel_heads: true # --- optimizer configuration --- optimizer: _target_: torch.optim.AdamW diff --git a/gabbro/models/backbone.py b/gabbro/models/backbone.py index dd0d551..3bab562 100644 --- a/gabbro/models/backbone.py +++ b/gabbro/models/backbone.py @@ -16,7 +16,6 @@ from gabbro.metrics.utils import calc_accuracy from gabbro.models.gpt_model import BackboneModel -from gabbro.models.gpt_model_sequential import FullModel # noqa: E402 vector.register_awkward() @@ -54,10 +53,7 @@ def __init__( self.save_hyperparameters(logger=False) # initialize the backbone - if model_kwargs.get("use_parallel_heads", False): - self.module = BackboneModel(**model_kwargs) - else: - self.module = FullModel(**model_kwargs) + self.module = BackboneModel(**model_kwargs) # initialize the model head self.head = NextTokenPredictionHead( From 5108669c0cd5e8647c2c3358416c779eb34d964a Mon Sep 17 00:00:00 2001 From: Joschka Birk Date: Wed, 22 May 2024 13:57:39 +0200 Subject: [PATCH 3/3] Update README --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6f8dd7c..6f57162 100644 --- a/README.md +++ b/README.md @@ -48,10 +48,11 @@ The recommended (and by us tested) way of running the code is to use the provided docker image at [`jobirk/omnijet` on DockerHub](https://hub.docker.com/repository/docker/jobirk/omnijet/general). The requirements listed in `docker/requirements.txt` are installed in the `conda` environment -of the base image, so you have to make sure that the `conda` environment is activated -when running the code. +`base` of the base image (official pytorch image). +Thus, you have to make sure that the `conda` environment is activated when running the code, +which can be done with `source /opt/conda/bin/activate`. -Thus, an interactive session can be started by running the following command: +An interactive session inside a container can be started by running the following command: ```shell # on a machine with Singularity @@ -63,8 +64,6 @@ docker run -it --rm jobirk/omnijet:latest bash # start a shell in the container source /opt/conda/bin/activate # activate the conda environment in the container ``` -where `` is the path to the root of the project on your local machine. - Alternatively, you can install the requirements from the `docker/requirements.txt` file, but you'll have to add `pytorch` to the list of requirements, since this is not included in the `requirements.txt` file (we use the official pytorch image as