{"id":19707072,"url":"https://github.com/geyang/pql","last_synced_at":"2025-02-27T14:31:21.316Z","repository":{"id":232983813,"uuid":"658891205","full_name":"geyang/pql","owner":"geyang","description":"Fork from PQL","archived":false,"fork":false,"pushed_at":"2023-06-26T17:49:22.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-10T12:58:29.647Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geyang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-06-26T17:48:39.000Z","updated_at":"2023-06-26T17:49:28.000Z","dependencies_parsed_at":"2024-04-12T20:54:58.375Z","dependency_job_id":"6ff865af-1fee-4dc7-9fc9-818c0305389d","html_url":"https://github.com/geyang/pql","commit_stats":null,"previous_names":["geyang/pql"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geyang%2Fpql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geyang%2Fpql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geyang%2Fpql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geyang%2Fpql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geyang","download_url":"https://codeload.github.com/geyang/pql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241023753,"owners_count":19896129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T21:37:52.472Z","updated_at":"2025-02-27T14:31:21.295Z","avatar_url":"https://github.com/geyang.png","language":"Python","readme":"# Parallel Q-Learning (PQL)\nThis repository provides an implementation of the paper \"Parallel *Q*-Learning: Scaling Off-policy Reinforcement Learning under Massively Parallel Simulation\".\n\n- [Installation](#installation)\n    - [Install :zap: PQL](#install_pql)\n    - [Install Isaac Gym](#install_isaac)\n- [System Requirements](#requirements)\n- [Usage](#usage)\n    - [Train with :zap: PQL](#usage_pql)\n    - [Baselines](#usage_baselines)\n    - [Logging](#usage_logging)\n    - [Saving and Loading](#usage_saving_loading)\n- [Citation](#citation)\n- [Acknowledgement](#acknowledgement)\n\n## Installation\n\n### Install :zap: PQL \u003ca name=\"install_pql\"\u003e\u003c/a\u003e\n\n1. Clone the package:\n\n    ```bash\n    git clone git@github.com:geyang/pql.git\n    cd pql\n    ```\n\n2. Create Conda environment and install dependencies:\n\n    ```bash\n    ./create_conda_env_pql.sh\n    pip install -e .\n    ```\n\n\n### Install Isaac Gym \u003ca name=\"install_isaac\"\u003e\u003c/a\u003e\n\n\u003e **Note**\n\u003e In original paper, we use Isaac Gym Preview 3 and task configs in commit ca7a4fb762f9581e39cc2aab644f18a83d6ab0ba in IsaacGymEnvs.\n\n1. Download and install Isaac Gym Preview 4 from https://developer.nvidia.com/isaac-gym\n\n2. Unzip the file:\n    ```bash\n    tar -xf IsaacGym_Preview_4_Package.tar.gz\n    ```\n\n3. Install IsaacGym\n    ```bash\n    cd isaacgym/python\n    pip install -e . --no-deps\n    ```\n\n5. Install IsaacGymEnvs\n\n    ```bash\n    git clone https://github.com/NVIDIA-Omniverse/IsaacGymEnvs.git\n    cd IsaacGymEnvs\n    pip install -e . --no-deps\n    ```\n    \n6. Export LIBRARY_PATH\n    \n    ```bash\n    export LD_LIBRARY_PATH=$(conda info --base)/envs/pql/lib/:$LD_LIBRARY_PATH\n    ```\n\n## System Requirements \u003ca name=\"requirements\"\u003e\u003c/a\u003e\n\u003e **Warning**\n\u003e Note that wall-clock efficiency highly depends on the GPU type and will decrease with smaller/fewer GPUs (check Section 4.4 in the paper).\n\nIsaac Gym requires an NVIDIA GPU. To train in the default configuration, we recommend a GPU with at least 10GB of VRAM. For smaller GPUs, you can decrease the number of parallel environments (`cfg.num_envs`), batch_size (`cfg.algo.batch_size`), replay buffer capacity (`cfg.algo.memory_size`), etc. :zap: PQL can run on 1/2/3 GPUs (set GPU ID `cfg.p_learner_gpu` and `cfg.v_learner_gpu`; default GPU ID for Isaac Gym env is `GPU:0`). \n\n\n## Usage\n\n### Train with :zap: PQL \u003ca name=\"usage_pql\"\u003e\u003c/a\u003e\n\nRun :zap: PQL on Shadow Hand task. A full list of tasks in Isaac Gym is available [here](https://github.com/NVIDIA-Omniverse/IsaacGymEnvs/blob/main/docs/rl_examples.md).\n\n```\npython train_pql.py task=ShadowHand\n```\n\nRun :zap: PQL-D (with distributional RL)\n\n```\npython train_pql.py task=ShadowHand algo.distl=True algo.cri_class=DistributionalDoubleQ\n```\n\n### Baselines \u003ca name=\"usage_baselines\"\u003e\u003c/a\u003e\n\nRun DDPG baseline\n\n```\npython train_baselines.py algo=ddpg_algo task=ShadowHand\n```\n\nRun SAC baseline\n\n```\npython train_baselines.py algo=sac_algo task=ShadowHand\n```\n\nRun PPO baseline\n\n```\npython train_baselines.py algo=ppo_algo task=ShadowHand isaac_param=True\n```\n\n### Logging \u003ca name=\"usage_logging\"\u003e\u003c/a\u003e\n\nWe use ML-Logger \n\n1. Add your profile here https://dash.ml/profile\n[//]: # (2. Get your API key from https://wandb.ai/authorize)\n3. set up your account in terminal\n    ```bash\n    export ML_LOGGER_USER=\u003cyour-username\u003e\n    export ML_LOGGER_ROOT=\u003clogging server end-point\u003e\n    ```\n    \n\n### Saving and Loading \u003ca name=\"usage_saving_loading\"\u003e\u003c/a\u003e\n\nCheckpoints are automatically saved as pickle files\n\nTo load and visualize the policy, run\n\n```bash\npython visualize.py task=ShadowHand headless=False num_envs=10 artifact=$team-name$/$project-name$/$run-id$/$version$\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeyang%2Fpql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeyang%2Fpql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeyang%2Fpql/lists"}