diff options
author | Geir Storli <geirst@verizonmedia.com> | 2020-12-09 14:49:59 +0000 |
---|---|---|
committer | Geir Storli <geirst@verizonmedia.com> | 2020-12-09 14:49:59 +0000 |
commit | a0f3ac3d96fbdf8c2a164bef0dfe994691087f2e (patch) | |
tree | e4d6d8913c722a4c61f9f1d312dfcf0a92082d9a | |
parent | b340d5e7985ad8604a15103e6e30d4a36caa2732 (diff) |
Revert "Remove "use-fast-value-tensor-implementation" flag."
7 files changed, 35 insertions, 8 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java b/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java index 5c04f9d1fd8..381f0ace69e 100644 --- a/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java @@ -69,6 +69,7 @@ public interface ModelContext { @ModelFeatureFlag(owners = {"baldersheim"}, comment = "Revisit in May or June 2020") default double defaultTermwiseLimit() { throw new UnsupportedOperationException("TODO specify default value"); } @ModelFeatureFlag(owners = {"vekterli"}) default boolean useThreePhaseUpdates() { throw new UnsupportedOperationException("TODO specify default value"); } @ModelFeatureFlag(owners = {"geirst"}, comment = "Remove on 7.XXX when this is default on") default boolean useDirectStorageApiRpc() { throw new UnsupportedOperationException("TODO specify default value"); } + @ModelFeatureFlag(owners = {"geirst"}, comment = "Remove on 7.XXX when this is default on") default boolean useFastValueTensorImplementation() { throw new UnsupportedOperationException("TODO specify default value"); } @ModelFeatureFlag(owners = {"baldersheim"}, comment = "Select sequencer type use while feeding") default String feedSequencerType() { throw new UnsupportedOperationException("TODO specify default value"); } @ModelFeatureFlag(owners = {"baldersheim"}) default String responseSequencerType() { throw new UnsupportedOperationException("TODO specify default value"); } @ModelFeatureFlag(owners = {"baldersheim"}) default int defaultNumResponseThreads() { return 2; } @@ -126,6 +127,7 @@ public interface ModelContext { @Deprecated double feedConcurrency(); @Deprecated boolean useThreePhaseUpdates(); @Deprecated boolean useDirectStorageApiRpc(); + @Deprecated boolean useFastValueTensorImplementation(); @Deprecated default boolean useAccessControlTlsHandshakeClientAuth() { return false; } } diff --git a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java index 3a90c335c48..2b819b731a1 100644 --- a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java +++ b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java @@ -38,6 +38,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea private boolean useDedicatedNodeForLogserver = false; private boolean useThreePhaseUpdates = false; private boolean useDirectStorageApiRpc = false; + private boolean useFastValueTensorImplementation = false; private double defaultTermwiseLimit = 1.0; private String jvmGCOptions = null; private String sequencerType = "LATENCY"; @@ -73,6 +74,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea @Override public double defaultTermwiseLimit() { return defaultTermwiseLimit; } @Override public boolean useThreePhaseUpdates() { return useThreePhaseUpdates; } @Override public boolean useDirectStorageApiRpc() { return useDirectStorageApiRpc; } + @Override public boolean useFastValueTensorImplementation() { return useFastValueTensorImplementation; } @Override public Optional<AthenzDomain> athenzDomain() { return Optional.ofNullable(athenzDomain); } @Override public Optional<ApplicationRoles> applicationRoles() { return Optional.ofNullable(applicationRoles); } @Override public String responseSequencerType() { return responseSequencerType; } @@ -138,6 +140,11 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea return this; } + public TestProperties setUseFastValueTensorImplementation(boolean useFastValueTensorImplementation) { + this.useFastValueTensorImplementation = useFastValueTensorImplementation; + return this; + } + public TestProperties setApplicationId(ApplicationId applicationId) { this.applicationId = applicationId; return this; diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java index b4ad8cb1267..bc1d138b6d5 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java @@ -267,7 +267,7 @@ public class ContentSearchCluster extends AbstractConfigProducer implements Prot TransactionLogServer tls; Optional<Tuning> tuning = Optional.ofNullable(this.tuning); if (element == null) { - searchNode = SearchNode.create(parent, "" + node.getDistributionKey(), node.getDistributionKey(), spec, + searchNode = SearchNode.create(deployState.getProperties(), parent, "" + node.getDistributionKey(), node.getDistributionKey(), spec, clusterName, node, flushOnShutdown, tuning, resourceLimits, parentGroup.isHosted(), combined); searchNode.setHostResource(node.getHostResource()); searchNode.initService(deployState.getDeployLogger()); diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java index 16302ddff49..9d3505e932f 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java @@ -69,6 +69,7 @@ public class SearchNode extends AbstractService implements private AbstractService serviceLayerService; private final Optional<Tuning> tuning; private final Optional<ResourceLimits> resourceLimits; + private final boolean useFastValueTensorImplementation; /** Whether this search node is co-located with a container node on a hosted system */ private final boolean combined; @@ -99,31 +100,31 @@ public class SearchNode extends AbstractService implements @Override protected SearchNode doBuild(DeployState deployState, AbstractConfigProducer ancestor, Element producerSpec) { - return new SearchNode(ancestor, name, contentNode.getDistributionKey(), nodeSpec, clusterName, contentNode, + return new SearchNode(deployState.getProperties(), ancestor, name, contentNode.getDistributionKey(), nodeSpec, clusterName, contentNode, flushOnShutdown, tuning, resourceLimits, deployState.isHosted(), combined); } } - public static SearchNode create(AbstractConfigProducer parent, String name, int distributionKey, NodeSpec nodeSpec, + public static SearchNode create(ModelContext.Properties props, AbstractConfigProducer parent, String name, int distributionKey, NodeSpec nodeSpec, String clusterName, AbstractService serviceLayerService, boolean flushOnShutdown, Optional<Tuning> tuning, Optional<ResourceLimits> resourceLimits, boolean isHostedVespa, boolean combined) { - return new SearchNode(parent, name, distributionKey, nodeSpec, clusterName, serviceLayerService, + return new SearchNode(props, parent, name, distributionKey, nodeSpec, clusterName, serviceLayerService, flushOnShutdown, tuning, resourceLimits, isHostedVespa, combined); } - private SearchNode(AbstractConfigProducer parent, String name, int distributionKey, NodeSpec nodeSpec, + private SearchNode(ModelContext.Properties props, AbstractConfigProducer parent, String name, int distributionKey, NodeSpec nodeSpec, String clusterName, AbstractService serviceLayerService, boolean flushOnShutdown, Optional<Tuning> tuning, Optional<ResourceLimits> resourceLimits, boolean isHostedVespa, boolean combined) { - this(parent, name, nodeSpec, clusterName, flushOnShutdown, tuning, resourceLimits, isHostedVespa, combined); + this(props, parent, name, nodeSpec, clusterName, flushOnShutdown, tuning, resourceLimits, isHostedVespa, combined); this.distributionKey = distributionKey; this.serviceLayerService = serviceLayerService; setPropertiesElastic(clusterName, distributionKey); } - private SearchNode(AbstractConfigProducer parent, String name, NodeSpec nodeSpec, String clusterName, + private SearchNode(ModelContext.Properties props, AbstractConfigProducer parent, String name, NodeSpec nodeSpec, String clusterName, boolean flushOnShutdown, Optional<Tuning> tuning, Optional<ResourceLimits> resourceLimits, boolean isHostedVespa, boolean combined) { super(parent, name); @@ -141,6 +142,7 @@ public class SearchNode extends AbstractService implements // Properties are set in DomSearchBuilder this.tuning = tuning; this.resourceLimits = resourceLimits; + this.useFastValueTensorImplementation = props.featureFlags().useFastValueTensorImplementation(); } private void setPropertiesElastic(String clusterName, int distributionKey) { @@ -295,6 +297,9 @@ public class SearchNode extends AbstractService implements tuning.ifPresent(t -> t.getConfig(builder)); resourceLimits.ifPresent(l -> l.getConfig(builder)); } + if (useFastValueTensorImplementation) { + builder.tensor_implementation(ProtonConfig.Tensor_implementation.FAST_VALUE); + } } @Override diff --git a/config-model/src/test/java/com/yahoo/vespa/model/search/test/SearchNodeTest.java b/config-model/src/test/java/com/yahoo/vespa/model/search/test/SearchNodeTest.java index e270c81fe78..e4dabfaddae 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/search/test/SearchNodeTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/search/test/SearchNodeTest.java @@ -53,7 +53,7 @@ public class SearchNodeTest { private static SearchNode createSearchNode(MockRoot root, String name, int distributionKey, NodeSpec nodeSpec, boolean flushOnShutDown, boolean isHosted, boolean combined) { - return SearchNode.create(root, name, distributionKey, nodeSpec, "mycluster", null, flushOnShutDown, Optional.empty(), Optional.empty(), isHosted, combined); + return SearchNode.create(root.getDeployState().getProperties(), root, name, distributionKey, nodeSpec, "mycluster", null, flushOnShutDown, Optional.empty(), Optional.empty(), isHosted, combined); } private static SearchNode createSearchNode(MockRoot root) { diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java index 15fedee3099..2d96c92bd88 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java @@ -153,6 +153,7 @@ public class ModelContextImpl implements ModelContext { private final double defaultTermwiseLimit; private final boolean useThreePhaseUpdates; private final boolean useDirectStorageApiRpc; + private final boolean useFastValueTensorImplementation; private final String feedSequencer; private final String responseSequencer; private final int numResponseThreads; @@ -171,6 +172,7 @@ public class ModelContextImpl implements ModelContext { this.defaultTermwiseLimit = flagValue(source, appId, Flags.DEFAULT_TERM_WISE_LIMIT); this.useThreePhaseUpdates = flagValue(source, appId, Flags.USE_THREE_PHASE_UPDATES); this.useDirectStorageApiRpc = flagValue(source, appId, Flags.USE_DIRECT_STORAGE_API_RPC); + this.useFastValueTensorImplementation = flagValue(source, appId, Flags.USE_FAST_VALUE_TENSOR_IMPLEMENTATION); this.feedSequencer = flagValue(source, appId, Flags.FEED_SEQUENCER_TYPE); this.responseSequencer = flagValue(source, appId, Flags.RESPONSE_SEQUENCER_TYPE); this.numResponseThreads = flagValue(source, appId, Flags.RESPONSE_NUM_THREADS); @@ -189,6 +191,7 @@ public class ModelContextImpl implements ModelContext { @Override public double defaultTermwiseLimit() { return defaultTermwiseLimit; } @Override public boolean useThreePhaseUpdates() { return useThreePhaseUpdates; } @Override public boolean useDirectStorageApiRpc() { return useDirectStorageApiRpc; } + @Override public boolean useFastValueTensorImplementation() { return useFastValueTensorImplementation; } @Override public String feedSequencerType() { return feedSequencer; } @Override public String responseSequencerType() { return responseSequencer; } @Override public int defaultNumResponseThreads() { return numResponseThreads; } @@ -235,6 +238,7 @@ public class ModelContextImpl implements ModelContext { private final double defaultTermwiseLimit; private final boolean useThreePhaseUpdates; private final boolean useDirectStorageApiRpc; + private final boolean useFastValueTensorImplementation; private final String feedSequencer; private final String responseSequencer; private final int numResponseThreads; @@ -281,6 +285,7 @@ public class ModelContextImpl implements ModelContext { defaultTermwiseLimit = flagValue(flagSource, applicationId, Flags.DEFAULT_TERM_WISE_LIMIT); useThreePhaseUpdates = flagValue(flagSource, applicationId, Flags.USE_THREE_PHASE_UPDATES); useDirectStorageApiRpc = flagValue(flagSource, applicationId, Flags.USE_DIRECT_STORAGE_API_RPC); + useFastValueTensorImplementation = flagValue(flagSource, applicationId, Flags.USE_FAST_VALUE_TENSOR_IMPLEMENTATION); feedSequencer = flagValue(flagSource, applicationId, Flags.FEED_SEQUENCER_TYPE); responseSequencer = flagValue(flagSource, applicationId, Flags.RESPONSE_SEQUENCER_TYPE); numResponseThreads = flagValue(flagSource, applicationId, Flags.RESPONSE_NUM_THREADS); @@ -352,6 +357,7 @@ public class ModelContextImpl implements ModelContext { @Override public double defaultTermwiseLimit() { return defaultTermwiseLimit; } @Override public boolean useThreePhaseUpdates() { return useThreePhaseUpdates; } @Override public boolean useDirectStorageApiRpc() { return useDirectStorageApiRpc; } + @Override public boolean useFastValueTensorImplementation() { return useFastValueTensorImplementation; } @Override public String feedSequencerType() { return feedSequencer; } @Override public String responseSequencerType() { return responseSequencer; } @Override public int defaultNumResponseThreads() { return numResponseThreads; } diff --git a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java index 90d2db27b4f..a53c0bd6a78 100644 --- a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java +++ b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java @@ -113,6 +113,13 @@ public class Flags { "Takes effect at restart of distributor and content node process", ZONE_ID, APPLICATION_ID); + public static final UnboundBooleanFlag USE_FAST_VALUE_TENSOR_IMPLEMENTATION = defineFeatureFlag( + "use-fast-value-tensor-implementation", false, + List.of("geirst"), "2020-12-02", "2021-02-01", + "Whether to use FastValueBuilderFactory as the tensor implementation on all content nodes.", + "Takes effect at restart of content node process", + ZONE_ID, APPLICATION_ID); + public static final UnboundBooleanFlag HOST_HARDENING = defineFeatureFlag( "host-hardening", false, List.of("hakonhall"), "2020-12-02", "2021-02-01", |