Skip to content

create baselines #291

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/nvidia_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
- name: Create input files
shell: bash
run: |

# install jq
apt update && apt install -y jq

# Extract the payload content without printing it
apt-get update && apt-get install -y jq
PAYLOAD=$(jq -r '.inputs.payload' $GITHUB_EVENT_PATH)
Expand Down
2 changes: 1 addition & 1 deletion examples/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def main():
if mode == "benchmark":
return run_benchmarking(logger, pool, tests)

if mode == "leaderboard":
if mode == "leaderboard" or mode == "milestone":
# warmup
run_single_benchmark(pool, tests[0], False, 100, 1e7)
logger.log("benchmark-count", len(tests))
Expand Down
8 changes: 8 additions & 0 deletions examples/matmul_py/pytorch_ref.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!POPCORN leaderboard matmul_py

from task import input_t, output_t


def custom_kernel(data: input_t) -> output_t:
a, b = data
return a @ b
4 changes: 2 additions & 2 deletions examples/matmul_py/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def check_implementation(data: input_t, output: output_t) -> str:
reasons = verbose_allclose(output, expected)
if len(reasons) > 0:
# TODO better processing of reasons
return "mismatch found! custom implementation doesn't match reference.: " + reasons[0]
return False, "mismatch found! custom implementation doesn't match reference.: " + reasons[0]

return ''
return True, ''

14 changes: 14 additions & 0 deletions examples/matmul_py/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ files:
- {"name": "utils.py", "source": "../utils.py"}
- {"name": "reference.py", "source": "reference.py"}
- {"name": "eval.py", "source": "../eval.py"}
- {"name": "pytorch_ref.py", "source": "pytorch_ref.py"}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Milestones shouldn't be added here. These files get sent to the runner for every submission.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ohh is there another place to config problems or not really?

- {"name": "torch_mm_ref.py", "source": "torch_mm_ref.py"}

milestones:
- {
"milestone_name": "pytorch reference",
"filename": "pytorch_ref.py",
"description": "PyTorch reference implementation as a performance baseline for matmul"
}
- {
"milestone_name": "torch.mm reference",
"filename": "torch_mm_ref.py",
"description": "torch.mm reference implementation as a performance baseline for matmul"
}

lang: "py"

Expand Down
9 changes: 9 additions & 0 deletions examples/matmul_py/torch_mm_ref.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!POPCORN leaderboard matmul_py

from task import input_t, output_t
import torch


def custom_kernel(data: input_t) -> output_t:
a, b = data
return torch.mm(a, b)
6 changes: 5 additions & 1 deletion src/discord-cluster-manager/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,11 @@ async def run_submission( # noqa: C901
all_leaderboards = [lb["name"] for lb in db.get_leaderboards()]
if leaderboard_name not in all_leaderboards:
raise HTTPException(
status_code=404, detail=f"Leaderboard '{leaderboard_name}' not found."
status_code=404,
detail=(
f"Leaderboard '{leaderboard_name}' not found "
"when trying to run submission."
)
)
else:
raise HTTPException(
Expand Down
2 changes: 1 addition & 1 deletion src/discord-cluster-manager/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ async def _run_submission(
submission: SubmissionRequest, user_info: dict, mode: SubmissionMode, bot
):
try:
req = prepare_submission(submission, bot.leaderboard_db)
req = prepare_submission(submission, bot.leaderboard_db, mode)
except Exception as e:
raise HTTPException(status_code=400, detail=str(e)) from e

Expand Down
Loading
Loading