-
Notifications
You must be signed in to change notification settings - Fork 594
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
AVX present? #5291
AVX present? #5291
Changes from 2 commits
2af3c00
59ee071
91bb5c0
ac40183
1d75954
014211d
a1e13fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,11 @@ | |
import org.broadinstitute.hellbender.utils.runtime.AsynchronousStreamWriter; | ||
import org.broadinstitute.hellbender.utils.variant.GATKVCFConstants; | ||
import org.broadinstitute.hellbender.utils.variant.GATKVCFHeaderLines; | ||
import org.broadinstitute.hellbender.exceptions.UserException; | ||
import picard.cmdline.programgroups.VariantFilteringProgramGroup; | ||
|
||
import com.intel.gkl.IntelGKLUtils; | ||
|
||
import java.io.*; | ||
import java.util.*; | ||
|
||
|
@@ -108,6 +111,9 @@ public class CNNScoreVariants extends TwoPassVariantWalker { | |
"1D models will look at the reference sequence and variant annotations." + | ||
"2D models look at aligned reads, reference sequence, and variant annotations." + | ||
"2D models require a BAM file as input as well as the tensor-type argument to be set."; | ||
static final String AVXREQUIRED_ERROR = "This tool requires AVX instruction set support by default due to its dependency on recent versions of the TensorFlow library.\n" + | ||
" If you have an older (pre-1.6) version of TensorFlow installed that does not require AVX you may attempt to re-run the tool with the --disable-avx-check argument to bypass this check.\n" + | ||
" Note that such configurations are not officially supported."; | ||
|
||
private static final int CONTIG_INDEX = 0; | ||
private static final int POS_INDEX = 1; | ||
|
@@ -160,6 +166,11 @@ public class CNNScoreVariants extends TwoPassVariantWalker { | |
@Argument(fullName = "output-tensor-dir", shortName = "output-tensor-dir", doc = "Optional directory where tensors can be saved for debugging or visualization.", optional = true) | ||
private String outputTensorsDir = ""; | ||
|
||
@Advanced | ||
@Argument(fullName = "disable-avx-check", shortName = "disable-avx-check", doc = "If set, no check will be made for AVX support. " + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"Use only if you have installed a pre-1.6 TensorFlow build. ", optional = true) | ||
private boolean disableAVXCheck = false; | ||
|
||
@Hidden | ||
@Argument(fullName = "enable-journal", shortName = "enable-journal", doc = "Enable streaming process journal.", optional = true) | ||
private boolean enableJournal = false; | ||
|
@@ -232,8 +243,14 @@ public List<ReadFilter> getDefaultReadFilters() { | |
|
||
@Override | ||
public void onTraversalStart() { | ||
if (getHeaderForVariants().getGenotypeSamples().size() > 1) { | ||
logger.warn("CNNScoreVariants is a single sample tool, but the input VCF has more than 1 sample."); | ||
// Users can disable the AVX check to allow an older version of TF that doesn't require AVX to be used. | ||
if(this.disableAVXCheck == false) { | ||
IntelGKLUtils utils = new IntelGKLUtils(); | ||
utils.load(null); | ||
if (utils.isAvxSupported() == false) { | ||
// Give user the bad news, suggest remedies. | ||
throw new UserException.HardwareFeatureException(CNNScoreVariants.AVXREQUIRED_ERROR); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
// Start the Python process and initialize a stream writer for streaming data to the Python code | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a string constant
DISABLE_AVX_CHECK_NAME
for the valuedisable-avx-check
, and replace the argument name thats embedded in this String with a%s
format specifier. When the exception is thrown below, call call String.format passing it this string and theDISABLE_AVX_CHECK_NAME
string.