Skip to content

AD shards: the managed test/ad/runtests.jl does not split items by AD_SHARD #621

In review

Description

@seabbs-bot

Problem. With ad_shards, every shard of a backend still runs all of that backend's hand-written AD items, so sharding cannot bring a long reverse-mode job under its limit.

Suspected cause. The reusable ad.yml says the runner "must run only the kth of n parts of the tagged items".
The managed test/ad/runtests.jl template does not read AD_SHARD.
Only run_selected and test_working_backend read it, and they split the registry scenarios inside an item.
Every other item runs on each shard.

Proposed fix. Have the managed test/ad/runtests.jl deal the matched items across shards, sorted by file and name, so the parts are disjoint and together complete.
Keep a single level of splitting.
Either stop test_working_backend splitting when the runner has already dealt items, or have the runner leave items that call it to the scenario split.

Detail
  • In ComposableRecurrences.jl the items outside the registry are more than half of a reverse-mode job.
    In its package-owned AD versions workflow (run 46433453329, Julia 1.12, no coverage), enzyme_reverse took 56 min for the registry items and 65 min for the rest.
  • The main AD jobs for Enzyme reverse and Mooncake reverse have been cancelled at their 75 min limit on every run since 21 November.
  • With two shards as the kit splits today, each shard would still run the 65 min of other items plus half the registry, so it would still exceed the limit.
  • This follows from item 1 of Workflow changes ComposableRecurrences needs: AD job shards or a longer limit, package-scoped coverage, operating systems per event, and downstream test arguments #567, which asked for the runner to run "the kth of n parts of the tagged items, sorted by file and name and dealt in turn".

This was opened by a bot. Please ping @seabbs for any questions.

Activity

  1. added
    bot
    on Dec 4, 2026
  2. seabbs-bot commented on Dec 5, 2026

    @seabbs-bot
    CollaboratorAuthor

    Numbers from ComposableRecurrences.jl, Enzyme reverse split in two (ad_shards), Julia 1.13 with coverage, run 47466446534.

    Shard 1/2 took 98m47s of tests, and over half of that was items the split does not touch:

    File Time Split?
    adjoints.jl 42m27s no
    scenarios.jl (registry) 40m15s yes
    chunked.jl 8m20s no
    five smaller files about 8m no

    Shard 2/2 was cancelled at the 120-minute cap after 114 minutes of tests.

    The package now works around this in ComposableRecurrences.jl#1067. A small ad_shard() reader there lets its own items take_slice their part, and it moves to 3 shards.
    A kit-level answer would be either of these:

    • a public ad_shard() helper for package items to use;
    • the managed test/ad/runtests.jl splitting whole items round-robin, balanced by recorded times.

    This was opened by a bot. Please ping @seabbs for any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bot

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions