SnowPro Advanced: MLOps Engineer free question 4 / 10 · Domain 2: MLOps Infrastructure and Management
Data scientists develop in VS Code on their laptops. They want one Python training function to run on a GPU compute pool in Snowflake, while they keep working in VS Code. What do the ML Jobs docs describe for this?
- Decorate the function with @remote, naming the pool and a stage.
- Pass the function object to submit_file along with the pool name.
- Wrap it in a stored procedure on a Snowpark-optimized warehouse.
- Copy the function into a Workspaces notebook, as a job starts from there.
Show the answer and explanation
Answer: A
Why this is correct
The section "Run a Python function as a Snowflake ML Job" says to use Function Dispatch to run individual Python functions remotely on Snowflake's compute resources with the @remote decorator. The decorator serializes the function and its dependencies and executes it within a specific Container Runtime. The example passes the compute pool name to the decorator. Calling the decorated function submits the job and returns an MLJob object, so the scientists keep their editor and the training runs on the GPU pool.
Why the other options are wrong
"Copy the function into a Workspaces notebook, as a job starts from there." … The ML Jobs page says you can run jobs from any development environment and do not need to run the code in a Snowflake worksheet or notebook. Keeping the work in VS Code is one of the uses it lists.
"Pass the function object to submit_file along with the pool name." … submit_file is one of the file-based methods. It runs a single Python file, while individual functions are dispatched with the decorator, which serializes the function and its dependencies.
"Wrap it in a stored procedure on a Snowpark-optimized warehouse." … A stored procedure on a warehouse is a different place to run code. ML Jobs run inside Snowflake ML container runtimes on compute pools, which the page lists as including GPU instances, and that is the compute the team wants.
Function or file
ML Jobs offer two ways in: the @remote decorator for one function, and the file-based methods for scripts and project directories. Pick by the shape of the code. Either way, submitting needs an existing Snowpark session on the client, and the returned MLJob object is what you use to follow the run.