-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace nested scatter in TinyResolve with sharding subworkflow (#240)
- Loading branch information
1 parent
b0baf08
commit 6e99475
Showing
2 changed files
with
59 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version 1.0 | ||
|
||
workflow GetShardInputs { | ||
input { | ||
Array[String] all_items | ||
Int shard_number | ||
Int items_per_shard | ||
Int num_items | ||
} | ||
|
||
scatter (j in range(items_per_shard)) { | ||
Int idx = shard_number * items_per_shard + j | ||
if (idx < num_items) { | ||
String shard_items_ = all_items[idx] | ||
} | ||
} | ||
|
||
output { | ||
Array[String] shard_items = select_all(shard_items_) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters