-
Notifications
You must be signed in to change notification settings - Fork 19
Move MAST app into .meta folder, modify the env setup to add in all workarounds #391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+193
−44
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Forge MAST Environment Setup | ||
|
||
A simple setup script to automatically configure your environment for running Forge with MAST jobs. | ||
This only applies to Meta internal users. | ||
|
||
## Quick Start | ||
|
||
⚠️ Important Note: the setup script will clone the forge repository under "/data/users/$USER". | ||
|
||
### 1. Run the Setup Script | ||
|
||
The `env_setup.sh` script will automatically: | ||
- ✅ Activate and configure the required conda environment | ||
- ✅ Clone/update the Forge repository | ||
- ✅ Install Forge package dependencies | ||
- ✅ Mount the required oilfs workspace to `/mnt/wsfuse` | ||
- ✅ Configure your environment for MAST job submission | ||
|
||
```bash | ||
# Make the script executable | ||
chmod +x .meta/mast/env_setup.sh | ||
|
||
# Run the setup | ||
./.meta/mast/env_setup.sh | ||
|
||
``` | ||
|
||
### 2. Submit MAST job | ||
|
||
Use the launch script to submit a MAST job: | ||
|
||
```bash | ||
# Make the launch script executable (first time only) | ||
chmod +x .meta/mast/launch.sh | ||
|
||
# Launch a job with your desired config | ||
./.meta/mast/launch.sh .meta/mast/qwen3_1_7b_mast.yaml | ||
``` | ||
|
||
The launch script will automatically: | ||
- Navigate to the forge root directory | ||
- Reinstall the forge package with your latest changes | ||
- Set the correct PYTHONPATH | ||
- Launch the MAST job with the specified config | ||
|
||
You can run it from anywhere, and it will figure out the correct paths. |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/bin/bash | ||
|
||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
# launch.sh - Launch MAST jobs with Forge | ||
set -e # Exit on any error | ||
|
||
# Colors for output | ||
RED='\033[0;31m' | ||
GREEN='\033[0;32m' | ||
YELLOW='\033[1;33m' | ||
NC='\033[0m' # No Color | ||
|
||
# Logging functions | ||
log_info() { | ||
echo -e "${GREEN}[INFO]${NC} $1" | ||
} | ||
|
||
log_error() { | ||
echo -e "${RED}[ERROR]${NC} $1" | ||
} | ||
|
||
# Check if config file is provided | ||
if [ $# -eq 0 ]; then | ||
log_error "No config file provided" | ||
echo "Usage: $0 <config_file>" | ||
echo "Example: $0 .meta/mast/qwen3_1_7b_mast.yaml" | ||
exit 1 | ||
fi | ||
|
||
CONFIG_FILE="$1" | ||
|
||
# Get the directory where this script is located | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
# Navigate to forge root (two levels up from .meta/mast/) | ||
FORGE_ROOT="$( cd "$SCRIPT_DIR/../.." && pwd )" | ||
|
||
log_info "Forge root directory: $FORGE_ROOT" | ||
log_info "Config file: $CONFIG_FILE" | ||
|
||
# Check if config file exists | ||
if [ ! -f "$FORGE_ROOT/$CONFIG_FILE" ]; then | ||
log_error "Config file not found: $FORGE_ROOT/$CONFIG_FILE" | ||
exit 1 | ||
fi | ||
|
||
# Navigate to forge root | ||
cd "$FORGE_ROOT" | ||
log_info "Changed to directory: $(pwd)" | ||
|
||
# Reinstall forge package | ||
log_info "Reinstalling forge package..." | ||
pip install --force-reinstall --no-deps . | ||
if [ $? -ne 0 ]; then | ||
log_error "Failed to reinstall forge package" | ||
exit 1 | ||
fi | ||
|
||
log_info "Successfully reinstalled forge package" | ||
|
||
# Launch the job | ||
log_info "Launching MAST job..." | ||
PYTHONPATH=. python .meta/mast/main.py --config "$CONFIG_FILE" |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/mast/qwen3_1_7b_mast.yaml → .meta/mast/qwen3_1_7b_mast.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.