meta

meta(**kwargs)

fiber.meta API allows you to decorate your function and provide some hints to Fiber. Currently this is mainly used for specify the resource usage of user functions.

Currently, support keys are:

key Type Default Notes
cpu int None The number of CPU cores that this function needs
memory int None The size of memory space in MB this function needs
gpu int None The number of GPUs that this function needs. For how to setup Fiber with GPUs, check out here

Example usage:

@fiber.meta(cpu=4, memory=1000, gpu=1)
def func():
    do_something()