Skip to content

Commit afe87ba

Browse files
authored
Merge pull request #46 from dhruvdcoder/improve-contrib-guide
Improve contribution docs, templates, and sync xlm-models versioning
2 parents d043e57 + d5a48f6 commit afe87ba

28 files changed

Lines changed: 1026 additions & 448 deletions

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,44 @@ assignees: ''
1111
A clear and concise description of what the bug is.
1212

1313
**To Reproduce**
14-
Here is the minimal python script that reproduces the issue...
14+
Minimal repro: an `xlm` command or Python script.
1515

16+
```bash
17+
# Example
18+
xlm job_type=train job_name=repro experiment=... debug=overfit
19+
```
20+
21+
```python
22+
# Or minimal Python
23+
```
1624

1725
**Expected behavior**
18-
A clear and concise description of what you expected to happen.
26+
What you expected to happen.
1927

20-
**Screenshots**
21-
If applicable, add screenshots to help explain your problem.
28+
**Actual behavior**
29+
What happened instead (traceback, wrong metrics, etc.).
30+
31+
**Relevant config**
32+
Hydra experiment and overrides (paste or link):
33+
34+
```yaml
35+
experiment=...
36+
# +overrides
37+
```
2238

2339
**Environment**
24-
- OS:
25-
- Pytorch version
26-
- Lightning version
27-
- Transformers version
28-
- Hydra version
2940

41+
- OS:
42+
- Python:
43+
- xlm-core: <!-- python -c "import xlm; print(xlm.__version__)" -->
44+
- xlm-models (if applicable):
45+
- PyTorch:
46+
- Lightning:
47+
- Transformers:
48+
- Hydra:
3049

50+
**Screenshots**
51+
If applicable.
3152

3253
**Additional context**
33-
Add any other context about the problem here.
54+
Logs, checkpoint paths, or links to related issues.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,22 @@ assignees: ''
88
---
99

1010
**Is your feature request related to a problem? Please describe.**
11-
A clear and concise description of what the problem is.
11+
A clear and concise description of what the problem is.
12+
13+
**Which component does this affect?**
14+
15+
- [ ] Core framework (`src/xlm/`)
16+
- [ ] Maintained Model family (`xlm-models/` )
17+
- [ ] Task / dataset
18+
- [ ] CLI / commands
19+
- [ ] Documentation
20+
- [ ] Other
1221

1322
**Describe the solution you'd like**
1423
A clear and concise description of what you want to happen.
1524

1625
**Describe alternatives you've considered**
17-
A clear and concise description of any alternative solutions or features you've considered.
26+
Any alternative solutions or features you've considered.
1827

1928
**Additional context**
20-
Add any other context or screenshots about the feature request here.
29+
Links to similar features in other frameworks.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: New model
3+
about: Propose a new language model family for XLM
4+
title: "[Model] ..."
5+
labels: new-model
6+
assignees: ''
7+
8+
---
9+
10+
**Model name**
11+
<!-- Short name (e.g. `my_nar_lm`) -->
12+
13+
**Paper / reference**
14+
<!-- arXiv link, OpenReview, project page, or brief description if no paper -->
15+
16+
**Where will it live?**
17+
18+
- [ ] Maintained in `xlm-models/` (this repo)
19+
- [ ] External repository (separate package)
20+
21+
**Architecture summary**
22+
<!-- How does generation differ from existing families (ARLM, ILM, MDLM, MLM, …)? -->
23+
24+
**Components**
25+
<!-- Which of the four pieces need non-standard behavior? -->
26+
27+
- [ ] Model (forward pass)
28+
- [ ] Loss
29+
- [ ] Predictor
30+
- [ ] Collator / datamodule
31+
32+
**Dependencies**
33+
<!-- Any new optional extras beyond core xlm-core? -->
34+
35+
**Checkpoints**
36+
<!-- Are there existing checkpoints that your code will allow loading or will you be providing checkpoints for your model? -->
37+
38+
- [ ] Existing checkpoints
39+
- [ ] New checkpoints
40+

.github/ISSUE_TEMPLATE/new_task.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: New task or dataset
3+
about: Propose wiring a new dataset or benchmark into XLM
4+
title: "[Task] ..."
5+
labels: new-task
6+
assignees: ''
7+
8+
---
9+
10+
**Dataset name**
11+
12+
**Source**
13+
<!-- Hugging Face Hub path (e.g. `namespace/dataset/split`), paper, or local path -->
14+
15+
**Task type**
16+
17+
- [ ] Language modeling (pretrain)
18+
- [ ] Seq2seq / instruction
19+
- [ ] Eval-only benchmark
20+
- [ ] Other (describe)
21+
22+
**Model families**
23+
<!-- Which families should support this task initially? e.g. ARLM, ILM, FlexMDM -->
24+
25+
**Preprocessing**
26+
<!-- Brief description of columns needed, filters, post-hoc evaluators -->
27+
28+
**Optional dependencies**
29+
<!-- e.g. `xlm-core[safe]`, chemistry stack, math-verify -->
30+
31+
**Additional context**
32+
<!-- Example rows, expected metrics, links to similar tasks in `src/xlm/tasks/` -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## What
2+
3+
<!-- 1–2 sentence summary of the change -->
4+
5+
## Contribution type
6+
7+
<!-- Check all that apply -->
8+
9+
- [ ] Maintained model (`xlm-models/`)
10+
- [ ] External model (separate repo)
11+
- [ ] Task or dataset
12+
- [ ] Core framework (`src/xlm/`)
13+
- [ ] Documentation
14+
- [ ] Bug fix
15+
- [ ] Other (describe below)
16+
17+
## Changes
18+
19+
<!-- Bullet list of what changed -->
20+
21+
-
22+
23+
## Testing
24+
25+
<!-- How you verified the change (commands, configs, screenshots) -->
26+
27+
```bash
28+
# e.g. pytest -m "not slow and not cli"
29+
```
30+
31+
## Documentation
32+
33+
<!-- Docs added or updated; link to pages if applicable -->
34+
35+
- [ ] No doc changes needed
36+
- [ ] Updated `docs/` and/or `mkdocs.yml`
37+
- [ ] Updated `CONTRIBUTING.md` or contributing guides
38+
39+
## Related issues
40+
41+
<!-- Link issues: Fixes #123, Closes #456 -->

.github/release.py

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/usr/bin/env python3
2-
"""Bump xlm-core version, push to main, and create a GitHub release.
2+
"""Bump xlm-core and xlm-models versions, push to main, and create a GitHub release.
33
44
Used locally and from .github/workflows/release.yml. The release tag is always
55
``v`` + the version read from ``src/xlm/version.py`` after the bump, matching
6-
publish.yml / docs-release.yml.
6+
publish.yml / docs-release.yml. Both ``src/xlm/version.py`` and
7+
``xlm-models/version.py`` are updated to the same version.
78
89
Examples:
910
python .github/release.py 0.1.4
@@ -23,6 +24,8 @@
2324

2425
REPO_ROOT = Path(__file__).resolve().parents[1]
2526
VERSION_PY = REPO_ROOT / "src" / "xlm" / "version.py"
27+
MODELS_VERSION_PY = REPO_ROOT / "xlm-models" / "version.py"
28+
VERSION_PY_PATHS = (VERSION_PY, MODELS_VERSION_PY)
2629
TAG_PREFIX = "v"
2730

2831
_VERSION_ENV_KEYS = (
@@ -173,7 +176,10 @@ def require_clean_tree(dry_run: bool) -> None:
173176

174177
def main(argv: list[str] | None = None) -> int:
175178
parser = argparse.ArgumentParser(
176-
description="Bump version.py, push to main, and publish a GitHub release.",
179+
description=(
180+
"Bump version.py files for xlm-core and xlm-models, push to main, "
181+
"and publish a GitHub release."
182+
),
177183
)
178184
parser.add_argument(
179185
"version",
@@ -246,16 +252,20 @@ def main(argv: list[str] | None = None) -> int:
246252

247253
if not args.publish_only:
248254
require_clean_tree(args.dry_run)
249-
write_version(target)
250-
written = read_version()
251-
if written != target.version:
252-
raise RuntimeError(
253-
f"version.py mismatch after write: expected {target.version}, got {written}"
254-
)
255-
print(f"Updated {VERSION_PY.relative_to(REPO_ROOT)}")
255+
for path in VERSION_PY_PATHS:
256+
write_version(target, path=path)
257+
written = read_version(path)
258+
if written != target.version:
259+
raise RuntimeError(
260+
f"{path} mismatch after write: expected {target.version}, got {written}"
261+
)
262+
print(f"Updated {path.relative_to(REPO_ROOT)}")
256263

257264
commit_msg = f"Release version {target.version}"
258-
run(["git", "add", str(VERSION_PY.relative_to(REPO_ROOT))], dry_run=args.dry_run)
265+
run(
266+
["git", "add", *[str(p.relative_to(REPO_ROOT)) for p in VERSION_PY_PATHS]],
267+
dry_run=args.dry_run,
268+
)
259269
run(["git", "commit", "-m", commit_msg], dry_run=args.dry_run)
260270

261271
if not args.skip_push:
@@ -278,7 +288,10 @@ def main(argv: list[str] | None = None) -> int:
278288
if args.dry_run:
279289
print("Dry run complete; no changes were pushed and no release was created.")
280290
else:
281-
print(f"Done. Published {target.tag} — PyPI/docs workflows run on release publish.")
291+
print(
292+
f"Done. Published {target.tag} — PyPI (xlm-core + xlm-models) and docs "
293+
"workflows run on release publish."
294+
)
282295
return 0
283296

284297

.github/workflows/publish.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
deploy:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1818
with:
1919
ref: ${{ github.event.inputs.tag_name || github.event.release.tag_name }}
2020
- name: Set up Python
21-
uses: actions/setup-python@v1
21+
uses: actions/setup-python@v5
2222
with:
2323
python-version: '3.x'
2424
- name: Install dependencies
@@ -47,7 +47,7 @@ jobs:
4747
echo "patch=$PATCH_NUM" >> $GITHUB_OUTPUT
4848
echo "suffix=$SUFFIX" >> $GITHUB_OUTPUT
4949
echo "Version extracted: $MAJOR.$MINOR.$PATCH_NUM$SUFFIX"
50-
- name: Build and publish
50+
- name: Build and publish xlm-core
5151
env:
5252
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
5353
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
@@ -57,4 +57,16 @@ jobs:
5757
XLM_CORE_VERSION_SUFFIX: ${{ steps.get_version.outputs.suffix }}
5858
run: |
5959
python setup.py sdist bdist_wheel
60-
twine upload dist/*
60+
twine upload dist/*
61+
- name: Build and publish xlm-models
62+
env:
63+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
64+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
65+
XLM_CORE_VERSION_MAJOR: ${{ steps.get_version.outputs.major }}
66+
XLM_CORE_VERSION_MINOR: ${{ steps.get_version.outputs.minor }}
67+
XLM_CORE_VERSION_PATCH: ${{ steps.get_version.outputs.patch }}
68+
XLM_CORE_VERSION_SUFFIX: ${{ steps.get_version.outputs.suffix }}
69+
run: |
70+
cd xlm-models
71+
python setup.py sdist bdist_wheel
72+
twine upload dist/*

0 commit comments

Comments
 (0)