Skip to content

Commit

Permalink
require env-variable opt-in tfor cpp code path
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzamora committed May 31, 2024
1 parent 25b3839 commit 6701251
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions merlin/systems/workflow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import functools
import json
import logging
import os

from merlin.dag import ColumnSelector, DataFormats, Supports
from merlin.dag.executors import LocalExecutor, _convert_format, _data_format
Expand Down Expand Up @@ -66,10 +67,12 @@ def __init__(self, workflow, output_dtypes, model_config, model_device):
)

# recurse over all column groups, initializing operators for inference pipeline.
# (disabled everything other than Categorify for now while we sort out whether
# (disabled everything other than operators that are specifically listed
# by the `NVT_CPP_OPS` environment variable while we sort out whether
# and how we want to use C++ implementations of NVTabular operators for
# performance optimization)
self._initialize_ops(self.workflow.output_node, restrict=["Categorify"])
_nvt_cpp_ops = os.environ.get("NVT_CPP_OPS", "").split(",")
self._initialize_ops(self.workflow.output_node, restrict=_nvt_cpp_ops)

def _initialize_ops(self, workflow_node, visited=None, restrict=None):
restrict = restrict or []
Expand Down

0 comments on commit 6701251

Please sign in to comment.