lablup / lablup/mlxcel

chore(scripts): mark the shebang-carrying Python scripts executable

Đang mở Phù hợp với người mới
#1,663 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
priority:low status:ready type:chore
Ngôn ngữ chính
Rust
Star
467
Fork
54
Merge trung bình
4 giờ 25 phút
Pull request đã merge (30 ngày)
310

Mô tả

## Summary

Eight Python scripts under `scripts/` carry a `#!/usr/bin/env python3` shebang but are not executable in the index, so the direct invocation some of them document for themselves fails with "permission denied".

## Background

The `scripts/ci/*.py` files (and `scripts/bench_mlxlm.py`) are already mode `100755`, so the executable convention is established. The affected files sit at `100644` despite their shebang. `scripts/bench_embeddings.py:9` documents its own invocation as `scripts/bench_embeddings.py --bin target/release/mlxcel-server ...`, which cannot run today.

## Proposed Solution

Set the executable bit in the index with `git update-index --chmod=+x` (or `chmod +x` then commit) on the shebang-carrying files. Verify with `git ls-files -s scripts/**/*.py`.

## Implementation Notes

- Non-executable despite a shebang: `scripts/bench_embeddings.py`, `scripts/benchmark_gemma3n_python.py`, `scripts/benchmark_llama3_python.py`, `scripts/benchmark_python.py`, `scripts/bridge_overhead_microbench_py.py`, `scripts/gather_qmm_shape_microbench.py`, `scripts/layer_shaped_microbench_py.py`, `scripts/requantize_mlp.py` (confirmed `100644` for the sampled files).
- Separately, `scripts/insert_apache_header.py`, `scripts/tools/internlm_rope_oracle.py`, and `scripts/tools/quantize_mtp_drafter.py` have neither a shebang nor `+x`. Decide whether to normalize them or leave them as `python3 ` only.

## Acceptance Criteria

- [ ] Every `scripts/**/*.py` with a shebang is executable in the index
- [ ] The three shebang-less files are either normalized or explicitly left alone with a note in the PR

---

## Original Suggestion

### Title: chore(scripts): make the shebang'd Python scripts executable

Ten Python scripts under `scripts/` carry a `#!/usr/bin/env python3` shebang but are not executable, so the invocation some of them document for themselves fails with "permission denied". Every `scripts/ci/*.py` (and `scripts/bench_mlxlm.py`) is `+x`, so the convention is established.

## Evidence

Non-executable despite a shebang: `scripts/bench_embeddings.py`, `scripts/benchmark_gemma3n_python.py`, `scripts/benchmark_llama3_python.py`, `scripts/benchmark_python.py`, `scripts/bridge_overhead_microbench_py.py`, `scripts/gather_qmm_shape_microbench.py`, `scripts/layer_shaped_microbench_py.py`, `scripts/requantize_mlp.py`.

`scripts/bench_embeddings.py:9` documents its own invocation as `scripts/bench_embeddings.py --bin target/release/mlxcel-server ...`, which fails today.

Separately, `scripts/insert_apache_header.py`, `scripts/tools/internlm_rope_oracle.py`, and `scripts/tools/quantize_mtp_drafter.py` have neither a shebang nor `+x` — decide whether to bring them in line or leave them as `python3 `-only.

## Suggested fix

`git update-index --chmod=+x` on the shebang'd files (or `chmod +x` + commit). Purely mechanical; verify with `git ls-files -s scripts/*.py`.

## Acceptance criteria

- [ ] Every `scripts/**/*.py` with a shebang is executable in the index
- [ ] The three shebang-less files are either normalized or explicitly left alone with a note in the PR

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Review the eight listed shebang-carrying files under scripts/ and compare their modes with scripts/ci/*.py and scripts/bench_mlxlm.py. Apply the executable bit in the index, then run git ls-files -s scripts/**/*.py to verify every shebang-bearing script is 100755. Check the three shebang-less files and record whether they remain non-executable or are normalized.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
git, python
Lĩnh vực
tooling
Loại issue
Lỗi
Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
84/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.