Skip to content

Commit

Permalink
Use conda environment yaml's for training-tuning-scripts (#1256)
Browse files Browse the repository at this point in the history
- Replace `requirements.txt`files (pip) with `requirements.yml` (conda environment).
- Update dependency versions.

Closes #1226
Closes #1227

## By Submitting this PR I confirm:
- I am familiar with the [Contributing Guidelines](https://github.com/nv-morpheus/Morpheus/blob/main/docs/source/developer_guide/contributing.md).
- When the PR is ready for review, new or existing tests cover these changes.
- When the PR is ready for review, the documentation is up to date with these changes.

Authors:
  - Eli Fajardo (https://github.com/efajardo-nv)

Approvers:
  - Michael Demoret (https://github.com/mdemoret-nv)

URL: #1256
  • Loading branch information
efajardo-nv authored Oct 13, 2023
1 parent c320903 commit 78c6e3a
Show file tree
Hide file tree
Showing 17 changed files with 360 additions and 183 deletions.
3 changes: 0 additions & 3 deletions models/training-tuning-scripts/abp-models/requirements.txt

This file was deleted.

25 changes: 25 additions & 0 deletions models/training-tuning-scripts/abp-models/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

channels:
- rapidsai
- nvidia
- conda-forge
dependencies:
- cuml=23.06
- jupyterlab
- python=3.10
- scikit-learn=1.2.2
- xgboost
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def main():
min_cats=1 # cut off for minority categories
)

model.fit(x_train, epochs=25, validation_data=x_val)
model.fit(x_train, epochs=25, validation_data=x_val, run_validation=True)

torch.save(model.state_dict(), args.trainingdata[:-4] + ".pkl")
with open(args.trainingdata[:-4] + 'dill' + '.pkl', 'wb') as f:
Expand Down
290 changes: 144 additions & 146 deletions models/training-tuning-scripts/dfp-models/hammah-20211017.ipynb

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions models/training-tuning-scripts/dfp-models/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

channels:
- nvidia
- pytorch
- conda-forge
dependencies:
- dill
- jupyterlab
- matplotlib
- pandas=1.3
- python=3.10
- pytorch-cuda=11.8
- pytorch=2.0.1
- scikit-learn=1.2.2
- seaborn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -14,17 +14,20 @@
# limitations under the License.

channels:
- rapidsai
- nvidia
- conda-forge
- rapidsai
- nvidia
- dglteam/label/cu118
- pytorch
- conda-forge
dependencies:
- click==8.1.3
- cuml=23.06
- dgl==1.0.2+cu118
- numpy==1.23.5
- pandas==1.5.3
- scikit_learn==1.2.2
- torch==2.0.0+cu118
- torchmetrics==0.11.4
- tqdm==4.65.0
- xgboost==1.7.1
- click>=8
- cuml=23.06
- dgl
- jupyterlab
- matplotlib
- pytorch-cuda=11.8
- pytorch=2.0.1
- scikit-learn=1.2.2
- tqdm=4
- torchmetrics
- xgboost

This file was deleted.

30 changes: 30 additions & 0 deletions models/training-tuning-scripts/log-parsing-models/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

channels:
- rapidsai
- nvidia
- pytorch
- conda-forge
dependencies:
- cudf=23.06
- jupyterlab
- onnx
- python=3.10
- pytorch-cuda=11.8
- pytorch=2.0.1
- seqeval=1.2.2
- tqdm=4
- transformers

This file was deleted.

30 changes: 30 additions & 0 deletions models/training-tuning-scripts/phishing-models/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

channels:
- rapidsai
- nvidia
- pytorch
- conda-forge
dependencies:
- cudf=23.06
- jupyterlab
- onnx
- python=3.10
- pytorch-cuda=11.8
- pytorch=2.0.1
- scikit-learn=1.2.2
- tqdm=4
- transformers

This file was deleted.

24 changes: 24 additions & 0 deletions models/training-tuning-scripts/ransomware-models/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

channels:
- conda-forge
dependencies:
- jupyterlab
- matplotlib
- pandas=1.3
- python=3.10
- scikit-learn=1.2.2
- seaborn

This file was deleted.

30 changes: 30 additions & 0 deletions models/training-tuning-scripts/root-cause-models/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

channels:
- rapidsai
- nvidia
- pytorch
- conda-forge
dependencies:
- cudf=23.06
- jupyterlab
- onnx
- python=3.10
- pytorch-cuda=11.8
- pytorch=2.0.1
- scikit-learn=1.2.2
- tqdm=4
- transformers
2 changes: 0 additions & 2 deletions models/training-tuning-scripts/sid-models/requirements.txt

This file was deleted.

30 changes: 30 additions & 0 deletions models/training-tuning-scripts/sid-models/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

channels:
- rapidsai
- nvidia
- pytorch
- conda-forge
dependencies:
- cudf=23.06
- jupyterlab
- onnx
- python=3.10
- pytorch-cuda=11.8
- pytorch=2.0.1
- scikit-learn=1.2.2
- tqdm=4
- transformers
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"outputs": [],
"source": [
"from os import path\n",
"import s3fs\n",
"import torch\n",
"from torch.nn import BCEWithLogitsLoss\n",
"from transformers import AutoModelForSequenceClassification, AdamW\n",
Expand Down

0 comments on commit 78c6e3a

Please sign in to comment.