Skip to content

Commit 57d73f0

Browse files
committed
[doc] Update redme.md with urartu v2.0 and add slurm in the action config
1 parent d85c7af commit 57d73f0

File tree

2 files changed

+58
-18
lines changed

2 files changed

+58
-18
lines changed

README.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,28 @@ We compare the abilities of state-of-the-art LLMs in embodying personas and hold
1818
<img width="350" alt="roleplay-schema" src="https://github.com/UKPLab/roleplay/assets/23078323/085c51e0-248b-4594-a2f6-6f820f662eba">
1919
</p>
2020

21-
The LLM Roleplay (roleplay) codebase is built upon the [UrarTU framework](https://github.com/tamohannes/urartu). For detailed insights into its structure, please refer to the [Getting Started Guide](https://github.com/tamohannes/urartu/blob/master/getting_started.md).
21+
The LLM Roleplay (roleplay) codebase is built upon the [UrarTU framework](https://github.com/tamohannes/urartu) (version 2). For detailed insights into its structure, please refer to the [Getting Started Guide](https://github.com/tamohannes/urartu/blob/master/getting_started.md).
2222

2323
## Installation
2424
Getting started with roleplay is a breeze! 💨 Just follow these steps to set up the necessary packages and create a local package called `roleplay`:
2525

26-
- Clone the repository: `git clone [email protected]:tamohannes/llm_roleplay.git`
26+
- Clone the repository: `git clone [email protected]:UKPLab/roleplay.git`
2727
- Navigate to the project directory: `cd roleplay`
2828
- Execute the magic command: `pip install .`
2929

30+
🪄 After running the previous command, `roleplay` will install the required packages including the latest version of `urartu` (>=2.0) and make it ready to use.
31+
Plus, an alias will be created, allowing you to access roleplay from any directory on your operating system effortlessly:
3032

31-
Adding a touch of convenience! 🪄 After running the previous command, `roleplay` will be set up and ready to use. Plus, an alias will be created, allowing you to access roleplay from any directory on your operating system effortlessly:
33+
```bash
34+
urartu --help
35+
```
3236

37+
Now, to register `roleplay` under the corresponding name in `urartu` we need to run the following command by providing the path where the module is located, for more info refere to [UrarTU's documentation](https://pypi.org/project/urartu/):
3338
```bash
34-
roleplay --help
39+
urartu register --name=roleplay --path=PATH_TO_ROLEPLAY/roleplay
3540
```
36-
<!-- > **Note for Usage on Slurm System**
37-
> For an enhanced experience with the Slurm job cancellation process, it is recommended to utilize a specific fork of the `submitit` package available at: [https://github.com/tamohannes/submitit](https://github.com/tamohannes/submitit). This fork includes the `ResumableSlurmJob.on_job_fail` callback, which allows the incorporation of additional functionality within this callback to ensure a graceful job termination. -->
41+
42+
After this you can run `urartu -h` again to see the available modules under `launch` command and make sure that `roleplay` is present there.
3843

3944

4045

@@ -63,12 +68,12 @@ aim up
6368
Let's get started with generating dialogues using the `roleplay` action. The process is simple: just provide the name of the configuration file containing the action, followed by the action name itself. For the `roleplay` action, we'll initiate it by using the Mistral 8x7B model as the inquirer. 🎇
6469

6570
```bash
66-
roleplay action_config=roleplay +action_config/task/model_inquirer=mixtral +action_config/task/model_responder=llama action_config.task.model_inquirer.api_token="YOUR_TOKEN"
71+
urartu launch --name=roleplay action_config=roleplay +action_config/task/model_inquirer=mixtral +action_config/task/model_responder=llama action_config.task.model_inquirer.api_token="YOUR_TOKEN"
6772
```
6873

6974
The `action_config` parameter specifies which configuration file to use to run the action. Afterward, we define the configuration file for the inquirer using the `model_inquirer` argument and set the configuration for the responder with the `model_responder` argument.
7075

71-
To execute the command on a Slurm cluster, configure the `roleplay/config/main.yaml` file with the corresponding fields, and then use the same command to run the job. For more details on how to edit the configuration files, please refer to the upcoming sections.
76+
To execute the command on a Slurm cluster, modify the `roleplay/configs/action_config/generate_dialogues.yaml` file with the corresponding fields, and then use the same command to run the job. For more details on how to edit the configuration files, please refer to the upcoming sections.
7277

7378
> **Huggingface Authentication**
7479
> You might need to log in to HuggingFace to authenticate your use of Mistral 8x7B. To do this, use the `huggingface-cli` login command and provide your access token.
@@ -77,35 +82,37 @@ To execute the command on a Slurm cluster, configure the `roleplay/config/main.y
7782

7883
## Configs: Tailoring Your Setup
7984

80-
The default configs which shape the way of configs are defined under `roleplay/config` directory:
81-
- `roleplay/config/main.yaml`: This core configuration file sets the foundation for default settings, covering all available keys within the system.
82-
- `roleplay/config/action_config` Directory: A designated space for specific action configurations.
85+
The default configs which shape the way of configs are defined in `urartu` under `urartu/config` directory:
86+
- `urartu/config/main.yaml`: This core configuration file sets the foundation for default settings, covering all available keys within the system.
87+
- `urartu/config/action_config` Directory: A designated space for specific action configurations.
88+
For more see the structure of [UrarTU](https://github.com/tamohannes/urartu).
8389

8490
### Crafting Customizations
8591

8692
You have two flexible options for tailoring your configurations in `roleplay`.
8793

88-
1. **Custom Config Files**: To simplify configuration adjustments, `roleplay` provides a dedicated `configs` directory where you can store personalized configuration files. These files seamlessly integrate with Hydra's search path. The directory structure mirrors that of `roleplay/config`. You can define project-specific configurations in specially named files. For instance, the `roleplay.yaml` file within the `configs` directory can house all the configurations specific to your `roleplay` project, with customized settings.
94+
1. **Custom Config Files**: To simplify configuration adjustments, `roleplay` provides a dedicated `configs` directory where you can store personalized configuration files. These files seamlessly integrate with Hydra's search path. The directory structure mirrors that of `urartu/config`. You can define project-specific configurations in specially named files.
95+
The `generate_dialogues.yaml` file within the `configs` directory houses all the configurations specific to our `roleplay` project, with customized settings.
8996

9097
- **Personalized User Configs**: To further tailor configurations for individual users, create a directory named `configs_{username}` at the same level as the `configs` directory, where `{username}` represents your operating system username (check out `configs_tamoyan` for an example). The beauty of this approach is that there are no additional steps required. Your customizations will smoothly load and override the default configurations, ensuring a seamless and hassle-free experience. ✨
9198

92-
The order of precedence for configuration overrides is as follows: `roleplay/config`, `configs`, `configs_{username}`, giving priority to user-specific configurations.
99+
The order of precedence for configuration overrides is as follows: `urartu/config`, `roleplay/configs`, `roleplay/configs_{username}`, giving priority to user-specific configurations.
93100

94-
2. **CLI Approach**: For those who prefer a command-line interface (CLI) approach, `roleplay` offers a convenient method. You can enhance your commands with specific key-value pairs directly in the CLI. For example, modifying your working directory path is as simple as:
101+
2. **CLI Approach**: For those who prefer a command-line interface (CLI) approach, `urartu` offers a convenient method. You can enhance your commands with specific key-value pairs directly in the CLI. For example, modifying your working directory path is as simple as:
95102

96103
```bash
97-
roleplay action_config=roleplay action_config.workdir=PATH_TO_WORKDIR
104+
urartu launch --name=roleplay action_config=roleplay action_config.workdir=PATH_TO_WORKDIR
98105
```
99106

100-
Choose the method that suits your workflow best and enjoy the flexibility `roleplay` provides for crafting custom configurations.
107+
Choose the method that suits your workflow best and enjoy the flexibility `urartu` provides for crafting custom configurations.
101108

102109

103110
### Effortless Launch
104111

105-
With `roleplay`, launching actions is incredibly easy, offering you two options. 🚀
112+
With `urartu`, launching actions is incredibly easy, offering you two options. 🚀
106113

107114
- **Local Marvel:** This option allows you to run jobs on your local machine, right where the script is executed.
108-
- **Cluster Voyage:** This choice takes you on a journey to the Slurm cluster. By adjusting the `slurm.use_slurm` setting in `config/main.yaml`, you can easily switch between local and cluster execution.
115+
- **Cluster Voyage:** This choice takes you on a journey to the Slurm cluster. By adjusting the `slurm.use_slurm` setting in `roleplay/configs/action_config/generate_dialogues.yaml`, you can easily switch between local and cluster execution.
109116

110117
Enjoy the flexibility to choose the launch adventure that best suits your needs and goals!
111118

roleplay/configs/action_config/generate_dialogues.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,39 @@ action_config:
201201
num_workers: 4
202202
shuffle: false
203203

204+
slurm:
205+
# Whether or not to run the job on SLURM
206+
use_slurm: false
207+
# Name of the job on SLURM
208+
name: "example"
209+
# Comment of the job on SLURM
210+
comment: "example job"
211+
# Partition of SLURM on which to run the job. This is a required field if using SLURM.
212+
partition: ""
213+
account: ""
214+
# Where the logs produced by the SLURM jobs will be output
215+
log_folder: "./slurm_logs"
216+
# Maximum number of hours / minutes needed by the job to complete. Above this limit, the job might be pre-empted.
217+
time_hours: 1
218+
time_minutes: 0
219+
# Additional constraints on the hardware of the nodes to allocate (example 'volta' to select a volta GPU)
220+
constraint: ""
221+
# GB of RAM memory to allocate for each node
222+
mem_gb: 100
223+
# TCP port on which the workers will synchronize themselves with torch distributed
224+
port_id: 40050
225+
# Number of CPUs per GPUs to request on the cluster.
226+
num_cpu_per_proc: 4
227+
# Number of GPUs per node to request on the cluster.
228+
num_gpu_per_node: 4
229+
# Number of nodes to request on the cluster.
230+
num_nodes: 1
231+
# Number of processes per node to request on the cluster.
232+
num_proc_per_node: 1
233+
# Any other parameters for slurm (e.g. account, hint, distribution, etc.,) as dictated by submitit.
234+
# Please see https://github.com/facebookincubator/submitit/issues/23#issuecomment-695217824.
235+
additional_parameters: {}
236+
204237
hydra:
205238
sweeper:
206239
params:

0 commit comments

Comments
 (0)