Skip to content

Commit

Permalink
Add more info to preallocate_params
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Nov 8, 2023
1 parent 9321ad0 commit 5df9cbd
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 13 deletions.
5 changes: 4 additions & 1 deletion lib/bumblebee/audio.ex
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ defmodule Bumblebee.Audio do
* `:preallocate_params` - when `true`, explicitly allocates params
on the device configured by `:defn_options`. You may want to set
this option when using partitioned serving, to allocate params
on each of the devices. Defaults to `false`
on each of the devices. When using this option, you should first
load the parameters into the host. This can be done by passing
`backend: {EXLA.Backend, client: :host}` to `load_model/1` and friends.
Defaults to `false`
* `:stream` - when `true`, the serving immediately returns a
stream that emits chunks as they are generated. Note that
Expand Down
5 changes: 4 additions & 1 deletion lib/bumblebee/diffusion/stable_diffusion.ex
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ defmodule Bumblebee.Diffusion.StableDiffusion do
* `:preallocate_params` - when `true`, explicitly allocates params
on the device configured by `:defn_options`. You may want to set
this option when using partitioned serving, to allocate params
on each of the devices. Defaults to `false`
on each of the devices. When using this option, you should first
load the parameters into the host. This can be done by passing
`backend: {EXLA.Backend, client: :host}` to `load_model/1` and friends.
Defaults to `false`
## Examples
Expand Down
40 changes: 32 additions & 8 deletions lib/bumblebee/text.ex
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ defmodule Bumblebee.Text do
* `:preallocate_params` - when `true`, explicitly allocates params
on the device configured by `:defn_options`. You may want to set
this option when using partitioned serving, to allocate params
on each of the devices. Defaults to `false`
on each of the devices. When using this option, you should first
load the parameters into the host. This can be done by passing
`backend: {EXLA.Backend, client: :host}` to `load_model/1` and friends.
Defaults to `false`
## Examples
Expand Down Expand Up @@ -160,7 +163,10 @@ defmodule Bumblebee.Text do
* `:preallocate_params` - when `true`, explicitly allocates params
on the device configured by `:defn_options`. You may want to set
this option when using partitioned serving, to allocate params
on each of the devices. Defaults to `false`
on each of the devices. When using this option, you should first
load the parameters into the host. This can be done by passing
`backend: {EXLA.Backend, client: :host}` to `load_model/1` and friends.
Defaults to `false`
* `:stream` - when `true`, the serving immediately returns a
stream that emits text chunks as they are generated. Note that
Expand Down Expand Up @@ -255,7 +261,10 @@ defmodule Bumblebee.Text do
* `:preallocate_params` - when `true`, explicitly allocates params
on the device configured by `:defn_options`. You may want to set
this option when using partitioned serving, to allocate params
on each of the devices. Defaults to `false`
on each of the devices. When using this option, you should first
load the parameters into the host. This can be done by passing
`backend: {EXLA.Backend, client: :host}` to `load_model/1` and friends.
Defaults to `false`
## Examples
Expand Down Expand Up @@ -329,7 +338,10 @@ defmodule Bumblebee.Text do
* `:preallocate_params` - when `true`, explicitly allocates params
on the device configured by `:defn_options`. You may want to set
this option when using partitioned serving, to allocate params
on each of the devices. Defaults to `false`
on each of the devices. When using this option, you should first
load the parameters into the host. This can be done by passing
`backend: {EXLA.Backend, client: :host}` to `load_model/1` and friends.
Defaults to `false`
## Examples
Expand Down Expand Up @@ -402,7 +414,10 @@ defmodule Bumblebee.Text do
* `:preallocate_params` - when `true`, explicitly allocates params
on the device configured by `:defn_options`. You may want to set
this option when using partitioned serving, to allocate params
on each of the devices. Defaults to `false`
on each of the devices. When using this option, you should first
load the parameters into the host. This can be done by passing
`backend: {EXLA.Backend, client: :host}` to `load_model/1` and friends.
Defaults to `false`
## Examples
Expand Down Expand Up @@ -472,7 +487,10 @@ defmodule Bumblebee.Text do
* `:preallocate_params` - when `true`, explicitly allocates params
on the device configured by `:defn_options`. You may want to set
this option when using partitioned serving, to allocate params
on each of the devices. Defaults to `false`
on each of the devices. When using this option, you should first
load the parameters into the host. This can be done by passing
`backend: {EXLA.Backend, client: :host}` to `load_model/1` and friends.
Defaults to `false`
## Examples
Expand Down Expand Up @@ -546,7 +564,10 @@ defmodule Bumblebee.Text do
* `:preallocate_params` - when `true`, explicitly allocates params
on the device configured by `:defn_options`. You may want to set
this option when using partitioned serving, to allocate params
on each of the devices. Defaults to `false`
on each of the devices. When using this option, you should first
load the parameters into the host. This can be done by passing
`backend: {EXLA.Backend, client: :host}` to `load_model/1` and friends.
Defaults to `false`
## Examples
Expand Down Expand Up @@ -619,7 +640,10 @@ defmodule Bumblebee.Text do
* `:preallocate_params` - when `true`, explicitly allocates params
on the device configured by `:defn_options`. You may want to set
this option when using partitioned serving, to allocate params
on each of the devices. Defaults to `false`
on each of the devices. When using this option, you should first
load the parameters into the host. This can be done by passing
`backend: {EXLA.Backend, client: :host}` to `load_model/1` and friends.
Defaults to `false`
## Examples
Expand Down
15 changes: 12 additions & 3 deletions lib/bumblebee/vision.ex
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ defmodule Bumblebee.Vision do
* `:preallocate_params` - when `true`, explicitly allocates params
on the device configured by `:defn_options`. You may want to set
this option when using partitioned serving, to allocate params
on each of the devices. Defaults to `false`
on each of the devices. When using this option, you should first
load the parameters into the host. This can be done by passing
`backend: {EXLA.Backend, client: :host}` to `load_model/1` and friends.
Defaults to `false`
## Examples
Expand Down Expand Up @@ -114,7 +117,10 @@ defmodule Bumblebee.Vision do
* `:preallocate_params` - when `true`, explicitly allocates params
on the device configured by `:defn_options`. You may want to set
this option when using partitioned serving, to allocate params
on each of the devices. Defaults to `false`
on each of the devices. When using this option, you should first
load the parameters into the host. This can be done by passing
`backend: {EXLA.Backend, client: :host}` to `load_model/1` and friends.
Defaults to `false`
## Examples
Expand Down Expand Up @@ -179,7 +185,10 @@ defmodule Bumblebee.Vision do
* `:preallocate_params` - when `true`, explicitly allocates params
on the device configured by `:defn_options`. You may want to set
this option when using partitioned serving, to allocate params
on each of the devices. Defaults to `false`
on each of the devices. When using this option, you should first
load the parameters into the host. This can be done by passing
`backend: {EXLA.Backend, client: :host}` to `load_model/1` and friends.
Defaults to `false`
## Examples
Expand Down

0 comments on commit 5df9cbd

Please sign in to comment.