Skip to content

Commit

Permalink
fast-track submission if only one GPU is possible
Browse files Browse the repository at this point in the history
  • Loading branch information
ngc92 committed Jan 21, 2025
1 parent 841f8f0 commit ec7ae96
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/discord-cluster-manager/cogs/leaderboard_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,13 @@ async def on_submit_hook(
)
return -1

view = await self.select_gpu_view(interaction, leaderboard_name, gpus)
# if there is more than one candidate GPU, display UI to let user select,
# otherwise just run on that GPU
if len(gpus) == 1:
selected_gpus = gpus
else:
view = await self.select_gpu_view(interaction, leaderboard_name, gpus)
selected_gpus = view.selected_gpus

tasks = [
self.async_submit_cog_job(
Expand All @@ -211,7 +217,7 @@ async def on_submit_hook(
AllGPU[gpu],
runner_name,
)
for gpu in view.selected_gpus
for gpu in selected_gpus
]

await asyncio.gather(*tasks)
Expand Down Expand Up @@ -734,13 +740,13 @@ async def leaderboard_create( # noqa: C901
auto_archive_duration=10080, # 7 days
)

await send_discord_message(
interaction,
f"Leaderboard '{leaderboard_name}'.\n"
+ f"Reference code: {reference_code}. Submission deadline: {date_value}"
+ f"\nForum thread: {thread.thread.mention}",
)
return
await send_discord_message(
interaction,
f"Leaderboard '{leaderboard_name}'.\n"
+ f"Reference code: {reference_code}. Submission deadline: {date_value}"
+ f"\nForum thread: {thread.thread.mention}",
)
return

except discord.Forbidden:
await send_discord_message(
Expand Down

0 comments on commit ec7ae96

Please sign in to comment.