diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 92d1194..e4237c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -258,8 +258,8 @@ jobs: --assets /tmp/assets.json \ --tag "${{ github.ref_name }}" \ --repo "${{ github.repository }}" \ - --output docs/release_history.md - python create_packages.py --assets /tmp/assets.json --output docs/packages.md + --output doc/release_history.md + python create_packages.py --assets /tmp/assets.json --output doc/packages.md - name: Commit and push docs updates run: | diff --git a/.github/workflows/update-download-stats.yml b/.github/workflows/update-download-stats.yml index f904420..30d71ad 100644 --- a/.github/workflows/update-download-stats.yml +++ b/.github/workflows/update-download-stats.yml @@ -34,7 +34,7 @@ jobs: run: | git config --global user.name "github-actions[bot]" git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add docs/data/download_history.json docs/data/download_graph.png + git add doc/data/download_history.json doc/data/download_graph.png git diff --staged --quiet || git commit -m "chore: update download statistics Update download statistics and graph for $(date -u +%Y-%m-%d)" diff --git a/README.md b/README.md index 84ecaf7..cbdc282 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ flash_attn-[flash_attn Version]+cu[CUDA Version]torch[PyTorch Version]-cp[Python flash_attn-2.6.3+cu124torch2.5-cp312-cp312-linux_x86_64.whl ``` -2. Find the corresponding version of a wheel from the **[Search Page](https://mjunya.com/flash-attention-prebuild-wheels/)**, [Packages](./docs/packages.md) page, or [releases](https://github.com/mjun0812/flash-attention-prebuild-wheels/releases) page. +2. Find the corresponding version of a wheel from the **[Search Page](https://mjunya.com/flash-attention-prebuild-wheels/)**, [Packages](./doc/packages.md) page, or [releases](https://github.com/mjun0812/flash-attention-prebuild-wheels/releases) page. 3. Direct Install or Download and Local Install @@ -51,11 +51,11 @@ pip install ./flash_attn-2.6.3+cu124torch2.5-cp312-cp312-linux_x86_64.whl > Since v0.5.0, wheels are built with a local version label indicating the CUDA and PyTorch versions. > Example: `pip list` -> `flash_attn==2.8.3 -> flash_attn==2.8.3+cu130torch2.9` -See [./docs/packages.md](./docs/packages.md) for the full list of available packages. +See [./doc/packages.md](./doc/packages.md) for the full list of available packages. ## History -History of this repository is available [here](./docs/release_history.md). +History of this repository is available [here](./doc/release_history.md). ## Citation @@ -91,7 +91,7 @@ If you use this repository in your research and find it helpful, please cite thi - + ## Original Repository diff --git a/create_packages.py b/create_packages.py index b369891..8bde562 100644 --- a/create_packages.py +++ b/create_packages.py @@ -1,6 +1,6 @@ -"""Create and update docs/packages.md from assets.json. +"""Create and update doc/packages.md from assets.json. -This script generates a comprehensive package documentation page (docs/packages.md) from +This script generates a comprehensive package documentation page (doc/packages.md) from GitHub release assets. It combines information from both assets.json and any existing packages.md file, creating organized tables grouped by OS and Flash-Attention version. @@ -17,11 +17,11 @@ Usage: Arguments: --assets: Path to assets.json file (default: assets.json) Can be obtained via `gh release view --json assets` - --output: Output file path (default: docs/packages.md) + --output: Output file path (default: doc/packages.md) Example: # Basic usage - python create_packages.py --assets assets.json --output docs/packages.md + python create_packages.py --assets assets.json --output doc/packages.md # Using defaults python create_packages.py @@ -56,7 +56,7 @@ ADD_NOTE = """> [!NOTE] def extract_packages_from_packages_md(packages_md_path: Path) -> list[dict]: - """Extract package information from existing docs/packages.md.""" + """Extract package information from existing doc/packages.md.""" if not packages_md_path.exists(): return [] @@ -442,7 +442,7 @@ def generate_markdown_table_by_os(df: pd.DataFrame) -> str: def main() -> None: parser = argparse.ArgumentParser( - description="Create and update docs/packages.md from assets.json" + description="Create and update doc/packages.md from assets.json" ) parser.add_argument( "--assets", @@ -453,8 +453,8 @@ def main() -> None: parser.add_argument( "--output", type=str, - default="docs/packages.md", - help="Output file path (default: docs/packages.md)", + default="doc/packages.md", + help="Output file path (default: doc/packages.md)", ) args = parser.parse_args() @@ -466,7 +466,7 @@ def main() -> None: if assets_path.exists(): assets_packages = extract_packages_from_assets_json(assets_path) - # Extract packages from existing docs/packages.md + # Extract packages from existing doc/packages.md packages_md_packages = extract_packages_from_packages_md(output_path) # Combine both lists diff --git a/docs/data/download_graph.png b/doc/data/download_graph.png similarity index 100% rename from docs/data/download_graph.png rename to doc/data/download_graph.png diff --git a/docs/data/download_history.json b/doc/data/download_history.json similarity index 100% rename from docs/data/download_history.json rename to doc/data/download_history.json diff --git a/docs/packages.md b/doc/packages.md similarity index 100% rename from docs/packages.md rename to doc/packages.md diff --git a/doc/plans/velvety-bouncing-starlight.md b/doc/plans/velvety-bouncing-starlight.md new file mode 100644 index 0000000..3eaab85 --- /dev/null +++ b/doc/plans/velvety-bouncing-starlight.md @@ -0,0 +1,141 @@ +# Flash-Attention Wheel 検索ページ 実装計画 + +## 概要 + +GitHub Releasesで公開されているFlash-Attentionプリビルドwheelを動的に取得し、フィルタリング・検索できるHTMLページをGitHub Pagesで公開する。 + +## ブランチ戦略 + +- **開発ブランチ**: `feat/add-search-page`(現在のブランチ) +- **公開**: mainブランチの`pages/`ディレクトリをGitHub Pagesとして公開 +- **GitHub Actions**: 不要(リポジトリ設定でpagesディレクトリを指定) + +## ファイル構成 + +``` +pages/ +└── index.html # 検索ページ(HTML/CSS/JS全て含む単一ファイル) +``` + +シンプルに単一HTMLファイルで完結させる(CSS/JSはインライン)。 + +## 主な機能 + +### 1. フィルタリング機能(ドロップダウン) +- Flash-Attention バージョン +- Python バージョン +- PyTorch バージョン +- CUDA バージョン +- プラットフォーム (OS) + +### 2. 結果表示 +- フィルタ条件に合うwheelをテーブル表示 +- 各行にダウンロードリンク +- リリースタグ表示 + +### 3. インストールコマンド生成 +- 行クリックで `pip install ` コマンド表示 +- コピーボタン(2種類) + - **Install Command**: `pip install ` をコピー + - **URL Only**: URLのみをコピー + +### 4. URLパラメータ対応 +- フィルタ状態をURLに保存(共有可能) + +## 技術詳細 + +### GitHub API使用 +- エンドポイント: `GET /repos/mjun0812/flash-attention-prebuild-wheels/releases` +- ページネーション対応(100件/ページ) +- レート制限: 60回/時間(認証なし) + +### レート制限対策 +- LocalStorageでキャッシュ(1時間有効) +- 初回ロード時のみAPIコール + +### Wheel名パース(common.pyから移植) +```javascript +const WHEEL_PATTERN = /flash_attn-(\d+\.\d+\.\d+(?:\.[a-z0-9]+)?)\+cu(\d+)torch(\d+\.\d+)-cp(\d+)-cp\d+-(.+?)\.whl/; +``` + +## 実装ステップ + +### Step 1: 基本構造 +- [ ] `pages/index.html` 作成(HTML/CSS/JS全て含む単一ファイル) + +### Step 2: 機能実装 +- [ ] GitHub API からリリース取得 +- [ ] wheelファイル名のパース +- [ ] フィルタリングロジック +- [ ] テーブル描画 + +### Step 3: UX改善 +- [ ] ローディング表示 +- [ ] エラーハンドリング +- [ ] インストールコマンド生成(pip install コピー) +- [ ] URLのみコピー機能 +- [ ] URLパラメータ対応 + +### Step 4: 最適化 +- [ ] LocalStorageキャッシュ +- [ ] 重複排除(同一組み合わせは最新のみ) + +## 対象ファイル + +| ファイル | 操作 | +|---------|------| +| `pages/index.html` | 新規作成 | + +## GitHub Pages 設定 + +リポジトリ設定で手動で設定: +1. Settings > Pages +2. Source: Deploy from a branch +3. Branch: `main` +4. Folder: `/pages` + +## 検証方法 + +1. ローカルでHTTPサーバー起動 + ```bash + cd pages && python -m http.server 8000 + ``` + +2. ブラウザで `http://localhost:8000` にアクセス + +3. 確認項目: + - フィルタが正しく動作する + - ダウンロードリンクが有効 + - Install Commandコピーが動作する + - URLコピーが動作する + - レスポンシブデザインが機能 + - APIエラー時にエラーメッセージ表示 + +4. mainブランチへマージ後、GitHub Pages設定を確認 + +## UI イメージ + +``` +┌─────────────────────────────────────────────────────────────┐ +│ Flash-Attention Prebuild Wheels │ +│ Search and download prebuilt wheels │ +├─────────────────────────────────────────────────────────────┤ +│ Flash-Attention ▼ │ Python ▼ │ PyTorch ▼ │ CUDA ▼ │ OS ▼ │ +│ [All Versions ] │ [All ] │ [All ] │ [All ] │ [All ] │ +│ [Reset Filters]│ +├─────────────────────────────────────────────────────────────┤ +│ 150 wheel(s) found │ +├─────────────────────────────────────────────────────────────┤ +│ Flash-Attn │ Python │ PyTorch │ CUDA │ Platform │ DL │ +├────────────┼────────┼─────────┼───────┼───────────────┼────┤ +│ 2.8.3 │ 3.11 │ 2.5 │ 12.4 │ Linux x86_64 │ ⬇ │ +│ 2.8.3 │ 3.10 │ 2.5 │ 12.4 │ Linux x86_64 │ ⬇ │ +│ ... │ ... │ ... │ ... │ ... │ ...│ +├─────────────────────────────────────────────────────────────┤ +│ Install Command │ +│ ┌─────────────────────────────────────────────────────────┐ │ +│ │ pip install https://github.com/.../flash_attn-2.8.3... │ │ +│ └─────────────────────────────────────────────────────────┘ │ +│ [Copy Command] [Copy URL] │ +└─────────────────────────────────────────────────────────────┘ +``` diff --git a/docs/release_history.md b/doc/release_history.md similarity index 100% rename from docs/release_history.md rename to doc/release_history.md diff --git a/pages/index.html b/docs/index.html similarity index 100% rename from pages/index.html rename to docs/index.html diff --git a/update_download_stats.py b/update_download_stats.py index c48e47f..02a7773 100644 --- a/update_download_stats.py +++ b/update_download_stats.py @@ -165,8 +165,8 @@ def main(): """Main function to update download statistics and generate graph.""" owner = "mjun0812" repo = "flash-attention-prebuild-wheels" - history_file = Path("docs/data/download_history.json") - graph_output = Path("docs/data/download_graph.png") + history_file = Path("doc/data/download_history.json") + graph_output = Path("doc/data/download_graph.png") # Fetch current stats print("Fetching download statistics from GitHub API...")