Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import torch
import paddle


def force_scheduler(cache_dic, current):
Expand All @@ -22,10 +21,10 @@ def force_scheduler(cache_dic, current):
else:
# TokenCache
linear_step_weight = 0.0
step_factor = torch.tensor(
step_factor = paddle.to_tensor(
1 - linear_step_weight + 2 * linear_step_weight * current["step"] / current["num_steps"]
)
threshold = torch.round(cache_dic["fresh_threshold"] / step_factor)
threshold = paddle.round(cache_dic["fresh_threshold"] / step_factor)

# no force constrain for sensitive steps, cause the performance is good enough.
# you may have a try.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@
from .double_transformer_forward import taylorseer_flux_double_block_forward
from .flux_forward import taylorseer_flux_forward
from .single_transformer_forward import taylorseer_flux_single_block_forward
from .xfuser_flux_forward import taylorseer_xfuser_flux_forward

This file was deleted.