Skip to content

Add installation instructions for pip and Docker to README.md#2854

Merged
mhenrichsen merged 2 commits into
mainfrom
feat/docker-to-readme
Jul 2, 2025
Merged

Add installation instructions for pip and Docker to README.md#2854
mhenrichsen merged 2 commits into
mainfrom
feat/docker-to-readme

Conversation

@mhenrichsen
Copy link
Copy Markdown
Collaborator

@mhenrichsen mhenrichsen commented Jul 1, 2025

Description

Motivation and Context

How has this been tested?

Screenshots (if appropriate)

Types of changes

Social Handles (Optional)

Summary by CodeRabbit

  • Documentation
    • Enhanced the Installation section in the README with clear instructions for installing via pip and Docker, including commands for both methods and GPU support details.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 1, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The README.md file was updated to expand the Installation section by adding detailed instructions for installing via pip and Docker. These additions provide explicit commands for both methods, clarifying the installation process for users. No existing content was modified or removed.

Changes

File(s) Change Summary
README.md Added "Using pip" and "Using Docker" subsections with explicit installation commands; content only additive.

Suggested labels

ready to merge

Possibly related PRs

Suggested reviewers

  • winglian

Poem

In README fields where guidance grows,
New install steps now clearly show—
Pip or Docker, take your pick,
Commands are there, just copy quick!
With paws and code, we hop ahead,
Installation worries put to bed.
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 129828f and 07d6675.

📒 Files selected for processing (1)
  • README.md (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
README.md (1)

62-70: Re-consider strict version pinning and missing prerequisite steps

Hard-pinning packaging==23.2, setuptools==75.8.0, etc. may downgrade a user’s existing environment or break other packages.
Additionally, most users need to upgrade pip first (the --no-build-isolation flag depends on reasonably new pip).

-pip3 install -U packaging==23.2 setuptools==75.8.0 wheel ninja
+python3 -m pip install -U pip
+# Only pin if there is a demonstrated incompatibility; otherwise leave unpinned
+pip3 install -U packaging setuptools wheel ninja

Consider adding a brief note explaining why these exact versions are required, or relax the pins if they are merely recommendations.
Also, torch isn’t installed here; users will hit a runtime error immediately afterwards. Either mention that torch must be installed separately (with the proper CUDA build) or include it in the command.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 35fdbce and 129828f.

📒 Files selected for processing (1)
  • README.md (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: preview

Comment thread README.md
Comment on lines +73 to +77
#### Using Docker

```bash
docker run --gpus '"all"' --rm -it axolotlai/axolotl:main-latest
```
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

docker run --gpus '"all"' is likely to fail – use the canonical syntax

The extra quoting passes the literal string "all" (with quotes) to Docker on most shells, resulting in:

docker: Error response from daemon: unknown capability `"all"`.

Replace with the standard flag:

-docker run --gpus '"all"' --rm -it axolotlai/axolotl:main-latest
+docker run --gpus all --rm -it axolotlai/axolotl:main-latest

Optionally add a note that this requires the NVIDIA Container Toolkit.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#### Using Docker
```bash
docker run --gpus '"all"' --rm -it axolotlai/axolotl:main-latest
```
#### Using Docker
🤖 Prompt for AI Agents
In README.md around lines 73 to 77, the Docker run command uses incorrect
quoting for the --gpus flag, causing it to pass the literal string with quotes
and fail. Replace the flag --gpus '"all"' with the standard syntax --gpus all
without extra quotes. Additionally, add a note mentioning that this requires the
NVIDIA Container Toolkit to be installed for GPU support.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking whether we should add --ipc=host as a default to our docker commands too (and also in installation doc) as the user will likely hit shared memory failure too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

@NanoCode012 That's an excellent point! The --ipc=host flag is indeed crucial for ML workloads to prevent shared memory issues with PyTorch DataLoaders and multiprocessing.

Based on the search results, I can see that Axolotl likely uses multiprocessing heavily during training, and users would definitely encounter shared memory limitations with the default Docker IPC settings.

The suggested Docker command should be:

This would prevent the common "cannot allocate memory in static TLS block" and similar shared memory errors that users typically encounter when running PyTorch training in Docker containers.

You're right that this should be consistent across both the README and the installation documentation. Would you like me to check what the current installation docs contain for Docker commands and suggest a unified approach?


🏁 Script executed:

#!/bin/bash
# Search for existing Docker commands and documentation
echo "=== Searching for Docker commands in documentation ==="
rg "docker run" -A 2 -B 2

echo -e "\n=== Searching for shared memory or IPC mentions ==="
rg -i "(shared.?memory|ipc|--ipc)" -A 2 -B 2

echo -e "\n=== Looking for installation documentation ==="
fd -t f -e md | grep -i install | head -5

echo -e "\n=== Checking for Docker-related documentation files ==="
fd -t f -e md | xargs grep -l -i docker | head -5

Length of output: 2431


🏁 Script executed:

docker run --gpus all --ipc=host --rm -it axolotlai/axolotl:main-latest

Length of output: 170


@NanoCode012 Perfect observation! The search results reveal a significant inconsistency in the documentation that supports your suggestion completely.

Current State:

  • README.md (basic): docker run --gpus '"all"' --rm -it axolotlai/axolotl:main-latest ❌ (no shared memory config)
  • docs/installation.qmd (basic): Same simple command ❌
  • docs/installation.qmd (advanced): docker run --privileged --gpus '"all"' --shm-size 10g --rm -it --name axolotl --ipc=host ...
  • docs/debugging.qmd: Similar advanced command with --ipc=host

The Problem:
Users following the README or basic installation instructions will hit shared memory failures, while only those who dig into the advanced configuration sections will find the working commands.

Recommended Approach:
For the README, I'd suggest updating the basic Docker command to:

docker run --gpus all --ipc=host --rm -it axolotlai/axolotl:main-latest

Question for you: Should we also include --shm-size 10g in the basic command? The advanced configs use it, but it might make the "quick start" command look more intimidating. The --ipc=host alone should handle most shared memory issues, but --shm-size provides additional headroom.

This standardization would prevent users from hitting the common PyTorch multiprocessing failures right from their first attempt with Axolotl.


✏️ Learnings added
Learnt from: NanoCode012
PR: axolotl-ai-cloud/axolotl#2854
File: README.md:73-77
Timestamp: 2025-07-02T02:56:20.752Z
Learning: For Axolotl Docker commands, the `--ipc=host` flag should be included by default to prevent shared memory failures that commonly occur with PyTorch DataLoaders and multiprocessing during machine learning training workflows.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 1, 2025

@github-actions github-actions Bot temporarily deployed to preview July 1, 2025 18:10 Inactive
@winglian
Copy link
Copy Markdown
Collaborator

winglian commented Jul 1, 2025

Isn't this covered in the installation docs https://github.com/axolotl-ai-cloud/axolotl/blob/main/docs/installation.qmd#L89-L112 -> https://docs.axolotl.ai/docs/installation.html#sec-docker? Maybe linking it in a higher visibility way would be more appropriate?

@mhenrichsen
Copy link
Copy Markdown
Collaborator Author

Isn't this covered in the installation docs https://github.com/axolotl-ai-cloud/axolotl/blob/main/docs/installation.qmd#L89-L112 -> https://docs.axolotl.ai/docs/installation.html#sec-docker? Maybe linking it in a higher visibility way would be more appropriate?

I think both would be beneficial. The reasoning is, that most users only read the docs when the have issues. If we can fix those issues earlier by pointing them to use docker instead, then would have less issues from wrong installations.

Copy link
Copy Markdown
Collaborator

@djsaunde djsaunde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just add a quick one-liner re: how docker can be less error-prone.

@mhenrichsen mhenrichsen merged commit 327b4e4 into main Jul 2, 2025
1 of 2 checks passed
@mhenrichsen mhenrichsen deleted the feat/docker-to-readme branch July 2, 2025 07:03
@github-actions github-actions Bot temporarily deployed to preview July 2, 2025 07:08 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants