Codabench

repository·develop·Indexed 41 days ago

https://github.com/codalab/codabench

An open-source, web-based platform for researchers and data scientists to collaborate on machine learning benchmarks and competitions. A modern successor to CodaLab Competitions, it facilitates reproducible research through shared worksheets and online competitions.

Tokens
55.2K
Snippets
152
Records
271
Agent score
52%

What's inside Codabench

  1. What is Codabench?

    develop

    Codabench is a platform for creating flexible benchmarks. The workflow typically involves:

    1. Defining Tasks: Specifying datasets and metrics of success.
    2. Specifying Submission APIs: Defining how algorithms (code) should be submitted.
    3. Adding Documentation: Providing context for participants.
    4. Leaderboard Management: Once created, the benchmark accepts submissions, and participant results are automatically appended to a leaderboard.

    Codabench also supports inverted benchmarks, where the roles are swapped: you specify reference algorithms, and participants submit datasets.

  2. Key differences between CodaLab and Codabench

    develop

    Codabench is designed as a modern upgrade to CodaLab. While it includes all features from CodaLab Competitions, it introduces several new capabilities:

    • Live Logs: View logs in real-time during the submission process.
    • Storage Quotas: Management of storage limits.
    • Computation Server Management: Tools for all users to manage servers.
    • Benchmarking Focus: Enhanced support for dataset submissions and the ability to have multiple leaderboard rows per user.
    • Interface: A faster and more intuitive user interface.
  3. New features in Codabench

    develop

    Codabench has introduced several new features for both participants and organizers, as well as backend improvements for developers and hosters:

    For Participants and Organizers

    • Public datasets listing: Access public datasets via the public datasets page.
    • Croissant standard compatibility: Support for the Croissant data standard.
    • New documentation website: Updated docs available at https://docs.codabench.org.
    • Submission management: Users can now delete their own submissions and manage their individual storage.
    • Public leaderboards: Leaderboards are accessible to everyone without requiring a login.

    For Developers and Hosters

    • Automated testing: Switched to using Playwright instead of Selenium.
    • Improved logging: Logs are now colored for better readability.
    • Dependency updates: Upgrades to Django and other core packages.
  4. Understand the CodaLab and Codabench ecosystem

    develop

    The CodaLab ecosystem provides tools for reproducible computational research through three primary components:

    • CodaLab Worksheets: Used to capture complex research pipelines as "executable papers". They support any data format or programming language. A public instance is hosted by Stanford University at https://worksheets.codalab.org/.
    • CodaLab Competitions: A platform for hosting community-driven data and computational challenges. A public instance is hosted by Université Paris-Saclay at https://codalab.lisn.fr/.
    • Codabench: An enhanced version of CodaLab Competitions designed for hosting competitions and benchmarks on virtually any data science problem. It offers improved performance and additional features. A public instance is hosted by Université Paris-Saclay at https://www.codabench.org/.
  5. What is Human-in-the-Loop (HITL)?

    develop

    Human-in-the-Loop (HITL) is a feature for private Compute Workers that introduces a manual validation step into the submission workflow.

    When enabled, the Compute Worker executes the scoring program but pauses after completion. It waits for a human operator to manually approve or reject the results before any scores, detailed results, or output archives are published to the Codabench site. This is useful for competitions requiring manual verification, such as medical AI or security-sensitive evaluations.

  6. Understand Submission Routing Rules and Queue Priority

    develop

    When a participant submits, Codabench routes the submission based on group membership.

    Queue Priority

    Routing follows this hierarchy: Group Queue > Competition Queue > Default Queue

    Key Routing Behaviors

    • Routing Trigger: Routing is only enabled if the participant belongs to at least one group.
    • Queue Deduplication: If multiple groups assigned to a participant reference the same compute queue, only one child submission is created for that queue to prevent duplicates.
    • Re-running Submissions: Re-running a submission uses the participant's current group memberships. If memberships changed since the original submission, the rerun may produce different child submissions.
    • Group Column: A Group column automatically appears on the leaderboard if routed groups are involved. It displays the group name and the main user submission ID (e.g., ID_GroupName).
  7. Manage and track competitions

    develop

    The competition management interface provides two primary views for tracking competitions via tab navigation:

    • Competitions I'm running tab: (Default view) Displays all competitions you currently manage or run. This view includes administrative actions such as editing, publishing, or deleting.
    • Competitions I'm in tab: Displays a list of competitions where you are a participant. This view does not include administrator options. Clicking a competition title in this list navigates you to that competition's detail page.
  8. Configure and Manage Storage with Minio

    develop

    Codabench uses Minio as its default object storage solution.

    • Port Configuration: The Minio port is defined in your .env file.
    • Bucket Initialization: A helper container named Create Buckets runs during startup. It checks for the existence of buckets defined in your .env settings and creates them if they are missing. This container typically exits after the initialization is complete.
  9. Provide local data to the compute worker

    develop

    You can provide large or confidential datasets directly to the worker to avoid downloading them during every job.

    1. Place your data in the folder $HOST_DIRECTORY/data on the host machine (e.g., /codabench/data).
    2. This folder is automatically mounted inside the competition container at /app/data.
    3. Requirement: You must modify your scoring or ingestion programs to point to /app/data to read this information.

    Warning: Ensure the file/folder ownership matches the user running the worker:

    • Use root for Docker rootfull.
    • Use codalab for Podman or Docker rootless (if you created a codalab user).
    # Example: If HOST_DIRECTORY=/codabench
    # Host path: /codabench/data
    # Container path: /app/data
  10. Understand leaderboard ranking and sorting logic

    develop

    Ranking is determined using a hierarchical sorting process:

    1. Primary Column: Ranking is first determined by the column at index 0 in the competition.yaml (though this can be adjusted in the competition editor). Sorting follows the asc or desc preference of that column.
    2. Secondary Columns: If scores are identical, the platform sorts by subsequent columns from left to right (based on their index).
    3. Tie-breaking: If all column scores are identical, the submitted_at timestamp is used as the final tie-breaker. Earlier submissions are ranked higher.
  11. Distinguish between Codabench Services and Submission Containers

    develop

    It is critical to distinguish between the two types of Docker environments in Codabench:

    1. Codabench Services: The infrastructure containers (Django, Postgres, Rabbit, etc.) that run the Codabench platform itself.
    2. Submission Containers: The isolated Docker environments used to run individual user submissions. These are specific to each benchmark and are managed separately from the core platform services.

    For details on the submission environment, see Submission Docker Container Layout.

  12. Understand the Codabench System Architecture

    develop

    Codabench is a distributed system composed of multiple Docker containers orchestrated via docker-compose. The architecture follows a pattern where a central Django application manages state and tasks, while specialized workers handle heavy lifting like computation and site-specific background tasks.

    Core Components:

    • Web Layer: Caddy acts as a reverse proxy (handling SSL/HTTPs on ports 80/443) for the Django application.
    • Application Layer: Django is the central hub running the Python code and a Gunicorn webserver (internally on port 8000). It manages the database, task queues, and storage orchestration.
    • Data & Storage Layer: Postgres (labeled db in docker-compose) stores relational data. Minio provides object storage, with a Create Buckets helper container used for initial bucket setup based on .env configurations.
    • Task & Messaging Layer: Rabbit (RabbitMQ) manages Celery task queues and compute worker queues. Flower provides an administrative UI for monitoring these Celery tasks and queues.
    • Worker Layer: Compute Worker containers execute user submissions. Site Worker containers handle background tasks for the Django app, such as unpacking competition bundles.
    graph TD
    A((User))
    B[Caddy]
    C{{Django}}
    D[Postgres]
    F{{Rabbit}}
    G[Minio]
    H[Create Buckets]
    I{{Builder}}
    K[Flower]
    L[Compute Worker]
    M[Site Worker]
    A --> B
    B --> C
    C --> D
    C --> F
    F --> L
    F --> M
    C -->|Storage|G
    G -->|Initialization Helper| H
    F --> K
    C -->|JS Asset Helper| I