Now also googlenet runs
This commit is contained in:
+4
-5
@@ -262,13 +262,12 @@ static void collectClosure(Value value, Block &body, const DeferredInputPlan &pl
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
bool isDeferredFragmentAssemblyInput(
|
bool isDeferredFragmentAssemblyInput(Value input) {
|
||||||
Value input, const ComputeInstance &consumerInstance) {
|
|
||||||
auto blueprint = input.getDefiningOp<SpatBlueprintOp>();
|
auto blueprint = input.getDefiningOp<SpatBlueprintOp>();
|
||||||
if (!blueprint || blueprint.getMode() != "fragment_assembly")
|
if (!blueprint || blueprint.getMode() != "fragment_assembly")
|
||||||
return false;
|
return false;
|
||||||
return llvm::all_of(getBlueprintFragments(blueprint), [&](Value fragment) {
|
return llvm::all_of(getBlueprintFragments(blueprint), [&](Value fragment) {
|
||||||
return getProducerValueRef(fragment, &consumerInstance).has_value();
|
return getProducerValueRef(fragment, nullptr).has_value();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,7 +278,7 @@ LogicalResult prepareSingleCpuInput(OpBuilder &, Location loc, Value input, Bloc
|
|||||||
Value graphLane, Value scheduledGraphLane,
|
Value graphLane, Value scheduledGraphLane,
|
||||||
DeferredInputPlan &plan) {
|
DeferredInputPlan &plan) {
|
||||||
plan = {graphInput, {}, {}, {}, graphLane, scheduledGraphLane, {}, {}, {}, {}, 1, nullptr};
|
plan = {graphInput, {}, {}, {}, graphLane, scheduledGraphLane, {}, {}, {}, {}, 1, nullptr};
|
||||||
if (isDeferredFragmentAssemblyInput(input, consumerInstance)) {
|
if (isDeferredFragmentAssemblyInput(input)) {
|
||||||
plan.blueprint = input.getDefiningOp<SpatBlueprintOp>();
|
plan.blueprint = input.getDefiningOp<SpatBlueprintOp>();
|
||||||
plan.originalSources = getBlueprintFragments(plan.blueprint);
|
plan.originalSources = getBlueprintFragments(plan.blueprint);
|
||||||
return success();
|
return success();
|
||||||
@@ -310,7 +309,7 @@ LogicalResult prepareMultiCpuTupleInput(OpBuilder &, Location loc, Value input,
|
|||||||
DeferredInputPlan &plan) {
|
DeferredInputPlan &plan) {
|
||||||
const ComputeInstance &representative = tuple.instances.front();
|
const ComputeInstance &representative = tuple.instances.front();
|
||||||
plan = {graphInput, {}, {}, {}, graphLane, scheduledGraphLane, scheduledLane, {}, {}, {}, 1, nullptr};
|
plan = {graphInput, {}, {}, {}, graphLane, scheduledGraphLane, scheduledLane, {}, {}, {}, 1, nullptr};
|
||||||
if (isDeferredFragmentAssemblyInput(input, representative)) {
|
if (isDeferredFragmentAssemblyInput(input)) {
|
||||||
plan.blueprint = input.getDefiningOp<SpatBlueprintOp>();
|
plan.blueprint = input.getDefiningOp<SpatBlueprintOp>();
|
||||||
plan.originalSources = getBlueprintFragments(plan.blueprint);
|
plan.originalSources = getBlueprintFragments(plan.blueprint);
|
||||||
return success();
|
return success();
|
||||||
|
|||||||
+1
-2
@@ -22,8 +22,7 @@ struct DeferredInputPlan {
|
|||||||
Block *scalarizedHoistBlock = nullptr;
|
Block *scalarizedHoistBlock = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool isDeferredFragmentAssemblyInput(Value input,
|
bool isDeferredFragmentAssemblyInput(Value input);
|
||||||
const ComputeInstance &consumerInstance);
|
|
||||||
|
|
||||||
LogicalResult prepareSingleCpuInput(OpBuilder &builder, Location loc, Value input,
|
LogicalResult prepareSingleCpuInput(OpBuilder &builder, Location loc, Value input,
|
||||||
BlockArgument graphInput,
|
BlockArgument graphInput,
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ LogicalResult collectPeftClassOperandsAndResults(
|
|||||||
for (Value weight : getComputeInstanceWeights(instance))
|
for (Value weight : getComputeInstanceWeights(instance))
|
||||||
appendUnique(peftClassPlan.weights, weight);
|
appendUnique(peftClassPlan.weights, weight);
|
||||||
for (Value input : getComputeInstanceInputs(instance))
|
for (Value input : getComputeInstanceInputs(instance))
|
||||||
if (!getProducerValueRef(input, &instance) && !isDeferredFragmentAssemblyInput(input, instance))
|
if (!getProducerValueRef(input, &instance) && !isDeferredFragmentAssemblyInput(input))
|
||||||
appendUnique(peftClassPlan.inputs, input);
|
appendUnique(peftClassPlan.inputs, input);
|
||||||
}
|
}
|
||||||
return success();
|
return success();
|
||||||
@@ -222,7 +222,7 @@ LogicalResult collectPeftClassOperandsAndResults(
|
|||||||
for (Value weight : getComputeInstanceWeights(instance))
|
for (Value weight : getComputeInstanceWeights(instance))
|
||||||
appendUnique(peftClassPlan.weights, weight);
|
appendUnique(peftClassPlan.weights, weight);
|
||||||
for (Value input : getComputeInstanceInputs(instance))
|
for (Value input : getComputeInstanceInputs(instance))
|
||||||
if (!getProducerValueRef(input, &instance) && !isDeferredFragmentAssemblyInput(input, instance))
|
if (!getProducerValueRef(input, &instance) && !isDeferredFragmentAssemblyInput(input))
|
||||||
appendUnique(peftClassPlan.inputs, input);
|
appendUnique(peftClassPlan.inputs, input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user