Skip to content
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

🥅 Add registration guardrails #1789

Closed
wants to merge 0 commits into from
Closed

🥅 Add registration guardrails #1789

wants to merge 0 commits into from

Conversation

shnizzedy
Copy link
Member

@shnizzedy shnizzedy commented Oct 5, 2022

Fixes

Related to FCP-INDI/TheWay#8 by @shnizzedy

Description

QC checks registration steps and either crashes or changes the random seed and retries the step.

Thresholds are specified in the pipeline config

registration_workflows:
# Minimum QC values to allow a run to complete post-registration
# Set any metric empty (like "Dice:") or to None to disable that guardrail
# Default thresholds adopted from XCP-Engine
# (https://github.com/PennLINC/xcpEngine/blob/397ab6cf/designs/cbf_all.dsn#L66)
quality_thresholds:
Dice: 0.8
Jaccard: 0.9
CrossCorr: 0.7
Coverage: 0.8

Technical details

Guardrails strategy

For a node that calculates a warp:

  1. Make a clone with an incremented seed.
  2. Put a guardrail on each of those two nodes, with the retry node raising a BadRegistrationError on QC failure.
  3. For each output, use a sequence of Nipype Merge and Select utility nodes to choose which node's outputs to used based on the failure status of the first-try node's guardrail.
    guardrail strategy

I've got some (I think) good ideas to abstract the guardrails further so the installation can be simpler in the future, but that'll be after 1.8.5 (if ever).

Also

  • Changes random.log with a single logged seed to random.tsv with a logged seed per try (to record the incremented seed for any retries that succeed where the first try failed)
  • Adds fallback forkable option for BBR where
    • Off does no BBR;
    • On does one BBR attempt with one seed-incremented retry;
    • fallback does one BBR attempt, falling back to no-BBR on failure
  • Exposes Nipype's stop_on_first_crash configuration option with new fail_fast config option

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I updated the changelog.
  • I added or updated documentation (📝 Document registration guardrails fcp-indi.github.io#293, in progress).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@shnizzedy shnizzedy self-assigned this Oct 5, 2022
@shnizzedy shnizzedy added 3 - Critical RBC https://github.com/PennLINC/RBC enhancement labels Oct 5, 2022
@shnizzedy shnizzedy force-pushed the enh/guardrails branch 2 times, most recently from 1845324 to 5648be6 Compare October 12, 2022 18:21
@shnizzedy shnizzedy force-pushed the enh/guardrails branch 3 times, most recently from 7c77f4b to c83ed62 Compare October 22, 2022 03:05
@shnizzedy shnizzedy added this to the 1.8.5 release milestone Oct 27, 2022
@shnizzedy shnizzedy changed the title 🚧 WIP 🥅 Add registration guardrails 🥅 Add registration guardrails Oct 28, 2022
@shnizzedy shnizzedy marked this pull request as ready for review October 28, 2022 21:12
@shnizzedy shnizzedy requested review from sgiavasis, gkiar and a team October 28, 2022 21:13
@shnizzedy
Copy link
Member Author

shnizzedy commented Oct 28, 2022

@FCP-INDI/developers I'll do the merge conflict resolution on Monday, but in reviewing this, please particularly look to see if I put the guardrails in appropriate places (where needed, not where not needed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Critical enhancement RBC https://github.com/PennLINC/RBC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant