Skip to content

Commit

Permalink
Remove inference deep batching option. Always run deep batching.
Browse files Browse the repository at this point in the history
  • Loading branch information
dickensc committed Nov 2, 2023
1 parent f70db5a commit 1cdb8be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,12 @@ public static void nextBatchAllDeepPredicates() {
*/
public static boolean isEpochCompleteAllDeepPredicates() {
boolean isEpochComplete = false;
boolean deepPredicates = false;

for (Predicate predicate : Predicate.getAll()) {
if (predicate instanceof DeepPredicate) {
deepPredicates = true;

isEpochComplete = (((DeepPredicate) predicate).isEpochComplete());

if (isEpochComplete) {
Expand All @@ -248,7 +251,7 @@ public static boolean isEpochCompleteAllDeepPredicates() {
}
}

return isEpochComplete;
return (!deepPredicates) || isEpochComplete;
}

private void writeObject(ObjectOutputStream out) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,6 @@ public class RuntimeOptions {
"Clear learning rules before inference. Useful when switching models between train and test."
);

public static final Option INFERENCE_DEEP_BATCHING = new Option(
"runtime.inference.deep.batching",
false,
"Whether deep models are batched. Inference should rerun until deep models terminates."
);

public static final Option LEARN = new Option(
"runtime.learn",
false,
Expand Down
7 changes: 1 addition & 6 deletions psl-java/src/main/java/org/linqs/psl/runtime/Runtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,7 @@ protected void runInferenceInternal(RuntimeConfig config, Model model, RuntimeRe

DeepPredicate.evalAllDeepPredicates();

if (RuntimeOptions.INFERENCE_DEEP_BATCHING.getBoolean()) {
DeepPredicate.nextBatchAllDeepPredicates();
runInference = !DeepPredicate.isEpochCompleteAllDeepPredicates();
} else {
runInference = false;
}
runInference = !DeepPredicate.isEpochCompleteAllDeepPredicates();
}
DeepPredicate.epochEndAllDeepPredicates();

Expand Down

0 comments on commit 1cdb8be

Please sign in to comment.