FSDP integration

What does this PR do?
Integrates fully sharded (ZeRO Stage 3) parallelism as seen in https://fairscale.readthedocs.io/en/latest/api/nn/fsdp.html
This also deprecates pipe + stops CI running the tests by updating the fairscale installation, as we move towards a full replacement primarily due to elegance and a long term future using FSDP.
Before submitting

[x] Was this discussed/approved via a GitHub issue? (not for typos and docs)
[x] Did you read the contributor guideline, Pull Request section?
[x] Did you make sure your PR does only one thing, instead of bundling different changes together?
[x] Did you make sure to update the documentation with your changes? (if necessary)
[x] Did you write any new necessary tests? (not for typos and docs)
[x] Did you verify new and existing tests pass locally with your changes?
[ ] Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review
Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

[x] Is this pull request ready for review? (if not, please submit in draft mode)
[x] Check that all items from Before submitting are resolved
[x] Make sure the title is self-explanatory and the description concisely explains the PR
[x] Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?
Make sure you had fun coding 🙃

To test cpu offload and to help me fix:
from argparse import ArgumentParser
import torch
from torch.nn import functional as F

import pytorch_lightning as pl
from pl_examples.basic_examples.mnist_datamodule import MNISTDataModule
from pytorch_lightning.plugins import FullShardedPlugin

class LitClassifier(pl.LightningModule):

    def __init__(self, hidden_dim=128, learning_rate=1e-3):
        super().__init__()
        self.save_hyperparameters()
        self.l1 = torch.nn.Linear(28 * 28, self.hparams.hidden_dim)
        self.l2 = torch.nn.Linear(self.hparams.hidden_dim, 10)

    def forward(self, x):
        x = x.view(x.size(0), -1)
        x = torch.relu(self.l1(x))
        x = torch.relu(self.l2(x))
        return x

    def training_step(self, batch, batch_idx):
        x, y = batch
        y_hat = self(x)
        loss = F.cross_entropy(y_hat, y)
        return loss

    def configure_optimizers(self):
        return torch.optim.Adam(self.trainer.model.parameters(), lr=self.hparams.learning_rate)

    @staticmethod
    def add_model_specific_args(parent_parser):
        parser = ArgumentParser(parents=[parent_parser], add_help=False)
        parser.add_argument('--hidden_dim', type=int, default=128)
        parser.add_argument('--learning_rate', type=float, default=0.0001)
        return parser

def cli_main():
    pl.seed_everything(1234)
    parser = ArgumentParser()
    parser = pl.Trainer.add_argparse_args(parser)
    parser = LitClassifier.add_model_specific_args(parser)
    parser = MNISTDataModule.add_argparse_args(parser)
    args = parser.parse_args()

    dm = MNISTDataModule.from_argparse_args(args)
    model = LitClassifier(args.hidden_dim, args.learning_rate)

    trainer = pl.Trainer.from_argparse_args(args, plugins=FullShardedPlugin(cpu_offload=True), precision=16, gpus=1,
                                            max_epochs=1)
    trainer.fit(model, datamodule=dm)

if __name__ == '__main__':
    cli_main()

Hello @SeanNaren! Thanks for updating this PR.

In the file pytorch_lightning/plugins/training_type/full_sharded.py:

Line 51:9: E265 block comment should start with '# '
Line 55:9: E265 block comment should start with '# '
Line 55:65: W291 trailing whitespace

Thanks for the extensive reviews guys it's much appreciated :) to give a status update
Issues
CPU Offload doesn't work currently with PyTorch Native AMP (no idea about APEX) when using the AMP Grad Scaler. This can be tracked by this issue: https://github.com/facebookresearch/fairscale/issues/421. Whilst we discuss long term upstream solution, we can use @tchaton's fix of delaying the grad moves (performance to be confirmed) https://github.com/PyTorchLightning/pytorch-lightning/commit/59dbb8371e0ef30f87316c18296b6ad372eee458 or we can disable this functionality for now. I think @tchaton solution may be worth while, but we might be able to move the logic into the FSDP class. Need to POC this out.
Flatten parameters removes all parameters within the lightning module, and moves them to a contiguous tensor. This means that when you're building your optimizer, you should refer to the wrapped model, not individual layers or the lightning module via self. This is being tracked in https://github.com/facebookresearch/fairscale/issues/430 but will be tricky to fix as this requires a re-write of the base bucketing (which is planned it seems).
For now I think an iterative solution here is to define a property in the lightning module that accesses the wrapped model, and give doc info on how to setup your optimizer using this property. We don't have a choice, given Myles' benchmarks: https://github.com/facebookresearch/fairscale/issues/430#issuecomment-785463057
Help Needed!
To get the best benefits (of scaling to ridiculous parameter sizes), we need to recommend wrapping child modules in the FSDP wrapper, like suggested in the main issue https://github.com/facebookresearch/fairscale/pull/413.
Because the FSDP wrapper requires torch distributed to be created, we need to delay the wrapping. I've gotten past this in the future by doing something like below:
from pytorch_lightning.plugins.fully_sharded import ShardedModule
class MyModel(pl.LightningModule):

    def __init__(self):
          ...
          self.linear = ShardedModule(torch.nn.Linear(5, 5))

ShardedModule will then do something like this:
class ShardedModule(nn.Module):
     def __init__(self, module):
         ...
         self.module = module

    def init_module(self):
         self.module = FullyShardedDataParallel(self.module)

   def forward(self, *args, **kwargs):
         return self.module(*args, **kwargs)

Any thoughts here?

To get the best benefits (of scaling to ridiculous parameter sizes), we need to recommend wrapping child modules in the FSDP wrapper, like suggested in the main issue facebookresearch/fairscale#413.

Note that this will be needed for large models (20B+) even after we add automatic wrapping, since initializing models of this size on CPU can cause users to run out of system RAM. Thus you want to be wrapping layers with FSDP as you initialize the layers, so that they get sharded in place and free CPU memory.

To get the best benefits (of scaling to ridiculous parameter sizes), we need to recommend wrapping child modules in the FSDP wrapper, like suggested in the main issue facebookresearch/fairscale#413.

Note that this will be needed for large models (20B+) even after we add automatic wrapping, since initializing models of this size on CPU can cause users to run out of system RAM. Thus you want to be wrapping layers with FSDP as you initialize the layers, so that they get sharded in place and free CPU memory.

Ah thanks for this, I did not see this! Brings up a great point that lazy init as I suggested won't solve in this case so we'll need to re-think further

When I did this in my custom modules, it was relatively straight forward like this (basically in any of the trainers hooks):
self.model = new_model.to(self.device, self.dtype)
self.trainer.optimizers, self.trainer.lr_schedulers, self.trainer.optimizer_frequencies = self.trainer.init_optimizers(
    self)

I kn ow, this isn't a perfect solution, but since it will be lightning-specific anyway, we should be able to just use it if we find the correct hook for this.

@ananthsub The thing with adding a hook for each plugin is that things will get polluted pretty soon.

I spoke to @ananthsub a bit offline about this idea, this would resolve the issue with wrapping particular layers of the model as well as allow the user to instantiate the layers one by one wrapping in FSDP to shard ASAP.
I think the hook is really promising, the concept of the hook needs to be general to all training type plugins in my opinion, so something like setup_manual_distributed_model within the lightningmodule would be nice.

To get the best benefits (of scaling to ridiculous parameter sizes), we need to recommend wrapping child modules in the FSDP wrapper, like suggested in the main issue facebookresearch/fairscale#413.

Note that this will be needed for large models (20B+) even after we add automatic wrapping, since initializing models of this size on CPU can cause users to run out of system RAM. Thus you want to be wrapping layers with FSDP as you initialize the layers, so that they get sharded in place and free CPU memory.

Ah thanks for this, I did not see this! Brings up a great point that lazy init as I suggested won't solve in this case so we'll need to re-think further

I wonder if FSDP can help here. There's already this behavior where the outer-most FSDP wrapper takes control of any nested FSDP instances (e.g., to share CUDA streams with nested instances and avoid unnecessary synchronizations). And a lot of the FSDP init happens lazily -- the main FSDP.__init__ really only handles the initial sharding, but the rest of the state is created on the first call to forward.
Perhaps we could add an FSDP.auto_wrap() helper that's really lightweight, and then a slightly heavier FSDP.enable_auto_wrap context manager to manage the auto_wraps. Something like:
class LitClassifier(pl.LightningModule):

    def __init__(self, hidden_dim=128, learning_rate=1e-3):
        super().__init__()
        self.save_hyperparameters()
        # auto_wrap will shard in-place if called within the FSDP.enable_auto_wrap() context, otherwise it's a no-op
        self.l1 = FSDP.auto_wrap(torch.nn.Linear(28 * 28, self.hparams.hidden_dim))
        self.l2 = FSDP.auto_wrap(torch.nn.Linear(self.hparams.hidden_dim, 10))
    (...)

def cli_main():
    (...)
    with FSDP.enable_auto_wrap(**handleful_of_important_params):  # causes the FSDP.auto_wrap to shard in-place
        model = LitClassifier(args.hidden_dim, args.learning_rate)
    (...)

Thoughts?

This test fails: https://github.com/PyTorchLightning/pytorch-lightning/blob/feat/fsdp/tests/plugins/test_fully_sharded_plugin.py#L131
This is because during training, the model parameters by default are flattened and stored separately from the actual lightning module within FSDP. This means when going to the next stage using the same lightning module, the weights cannot be correctly re-flattened by FSDP.
I think a solution here is to somehow restore the model to the state it was before training, with it unflattened however unsure how to do this. This will limit model size, but given we're prioritising single rank saving/loading then I think this is expected! cc @ananthsub @min-xu-ai

This test fails: https://github.com/PyTorchLightning/pytorch-lightning/blob/feat/fsdp/tests/plugins/test_fully_sharded_plugin.py#L131
This is because during training, the model parameters by default are flattened and stored separately from the actual lightning module within FSDP. This means when going to the next stage using the same lightning module, the weights cannot be correctly re-flattened by FSDP.
I think a solution here is to somehow restore the model to the state it was before training, with it unflattened however unsure how to do this. This will limit model size, but given we're prioritising single rank saving/loading then I think this is expected! cc @ananthsub @min-xu-ai @shuyingsunshine21

sorry, somehow I don't get email when you tag me here. Thanks to @ananthsub to let me know. I don't which line of the test is failing. It is due to flattening or sharding? We have the api of summon_full_params if it is sharding and users/the test can use it to access the full params for comparison. There isn't "unflattening" as far as I know. Once the params are flatten they are in a big tensor but in the forward or summon_full_params context, the original param variables are just like the unflattened ones in terms of their shapes but they are really a view into the big flat tensor.

This test fails: https://github.com/PyTorchLightning/pytorch-lightning/blob/feat/fsdp/tests/plugins/test_fully_sharded_plugin.py#L131
This is because during training, the model parameters by default are flattened and stored separately from the actual lightning module within FSDP. This means when going to the next stage using the same lightning module, the weights cannot be correctly re-flattened by FSDP.
I think a solution here is to somehow restore the model to the state it was before training, with it unflattened however unsure how to do this. This will limit model size, but given we're prioritising single rank saving/loading then I think this is expected! cc @ananthsub @min-xu-ai @shuyingsunshine21

sorry, somehow I don't get email when you tag me here. Thanks to @ananthsub to let me know. I don't which line of the test is failing. It is due to flattening or sharding? We have the api of summon_full_params if it is sharding and users/the test can use it to access the full params for comparison. There isn't "unflattening" as far as I know. Once the params are flatten they are in a big tensor but in the forward or summon_full_params context, the original param variables are just like the unflattened ones in terms of their shapes but they are really a view into the big flat tensor.

Thanks @min-xu-ai for the reply!
Yep I had a feeling this is the case, so just to simplify the steps that happens in lightning:

User defines model
User defines layers in auto_wrap context, which will automatically nest in FSDP wrapper
Within Trainer, we wrap the entire model for the user in FSDP
Trainer trains the model and returns the model with nested FSDP wrapper but no outer FSDP

If the user wants to test the model:

trainer.test(model) wraps the model again in FSDP <- this is where the code crashes I believe

I was curious if there was a way to go from the flattened parameters to the unflattened view permanently. One way would be to extract the consolidated state dict and reload it, however this would only happen on rank 0. Also this would be an expensive operation based on the model size!
There is also the other issue of ensuring the original FSDP flattened buffer is de-allocated before allocating again. Just spit balling here, but let me know your thoughts! cc @ananthsub

Here is a minimal reproducible example:
import torch
from fairscale.nn import wrap
from torch.utils.data import DataLoader, Dataset

from pytorch_lightning import Trainer, LightningModule
from pytorch_lightning.plugins import FullyShardedPlugin

class RandomDataset(Dataset):

    def __init__(self, size, length):
        self.len = length
        self.data = torch.randn(length, size)

    def __getitem__(self, index):
        return self.data[index]

    def __len__(self):
        return self.len

class BoringModel(LightningModule):

    def __init__(self):
        super().__init__()

    def forward(self, x):
        return self.layer(x)

    def loss(self, batch, prediction):
        # An arbitrary loss to have a loss that updates the model weights during `Trainer.fit` calls
        return torch.nn.functional.mse_loss(prediction, torch.ones_like(prediction))

    def training_step(self, batch, batch_idx):
        output = self(batch)
        loss = self.loss(batch, output)
        return {"loss": loss}

    def validation_step(self, batch, batch_idx):
        output = self(batch)
        loss = self.loss(batch, output)
        return {"x": loss}

    def test_step(self, batch, batch_idx):
        output = self(batch)
        loss = self.loss(batch, output)
        return {"y": loss}

    def configure_optimizers(self):
        optimizer = torch.optim.SGD(self.layer.parameters(), lr=0.1)
        lr_scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=1)
        return [optimizer], [lr_scheduler]

    def train_dataloader(self):
        return DataLoader(RandomDataset(32, 64))

    def val_dataloader(self):
        return DataLoader(RandomDataset(32, 64))

    def test_dataloader(self):
        return DataLoader(RandomDataset(32, 64))

if __name__ == '__main__':
    class TestModel(BoringModel):

        def configure_sharded_model(self) -> None:
            self.layer = torch.nn.Sequential(
                wrap(torch.nn.Linear(32, 32)),
                torch.nn.ReLU(),
                wrap(torch.nn.Linear(32, 2))
            )

    model = TestModel()
    trainer = Trainer(
        fast_dev_run=True,
        gpus=1,
        plugins=FullyShardedPlugin()
    )
    trainer.fit(model)
    trainer.test(model)

This crashes with:
Testing: 0it [00:00, ?it/s]Traceback (most recent call last):
  File "pytorch.py", line 82, in <module>
    trainer.test(model)
  File "/home/sean/pytorch-lightning/pytorch_lightning/trainer/trainer.py", line 965, in test
    results = self.fit(model)
  File "/home/sean/pytorch-lightning/pytorch_lightning/trainer/trainer.py", line 488, in fit
    self.dispatch()
  File "/home/sean/pytorch-lightning/pytorch_lightning/trainer/trainer.py", line 527, in dispatch
    self.accelerator.start_evaluating(self)
  File "/home/sean/pytorch-lightning/pytorch_lightning/accelerators/accelerator.py", line 96, in start_evaluating
    self.training_type_plugin.start_evaluating(trainer)
  File "/home/sean/pytorch-lightning/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 146, in start_evaluating
    self._results = trainer.run_stage()
  File "/home/sean/pytorch-lightning/pytorch_lightning/trainer/trainer.py", line 539, in run_stage
    results = self.run_evaluate()
  File "/home/sean/pytorch-lightning/pytorch_lightning/trainer/trainer.py", line 769, in run_evaluate
    eval_loop_results = self.run_evaluation()
  File "/home/sean/pytorch-lightning/pytorch_lightning/trainer/trainer.py", line 699, in run_evaluation
    output = self.evaluation_loop.evaluation_step(batch, batch_idx, dataloader_idx)
  File "/home/sean/pytorch-lightning/pytorch_lightning/trainer/evaluation_loop.py", line 168, in evaluation_step
    output = self.trainer.accelerator.test_step(args)
  File "/home/sean/pytorch-lightning/pytorch_lightning/accelerators/accelerator.py", line 223, in test_step
    return self.training_type_plugin.test_step(*args)
  File "/home/sean/pytorch-lightning/pytorch_lightning/plugins/training_type/ddp.py", line 337, in test_step
    return self.model(*args, **kwargs)
  File "/home/sean/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/sean/miniconda3/lib/python3.8/site-packages/fairscale/nn/data_parallel/fully_sharded_data_parallel.py", line 902, in forward
    self._lazy_init()
  File "/home/sean/miniconda3/lib/python3.8/site-packages/fairscale/nn/data_parallel/fully_sharded_data_parallel.py", line 745, in _lazy_init
    self._set_is_root()
  File "/home/sean/miniconda3/lib/python3.8/site-packages/fairscale/nn/data_parallel/fully_sharded_data_parallel.py", line 850, in _set_is_root
    assert m._is_root is None
AssertionError

Here is a minimal reproducible example:

Sounds like we may want to relax some constrains in FSDP. Will need to take a closer look when I can find time.

Here is a minimal reproducible example:

Sounds like we may want to relax some constrains in FSDP. Will need to take a closer look when I can find time.

@SeanNaren , @min-xu-ai , looks like modifying this piece https://github.com/facebookresearch/fairscale/blob/b0e6b9bdeb4270f600ef242b1b1f97f4a61e0a42/fairscale/nn/data_parallel/fully_sharded_data_parallel.py#L850-L859
to
  assert m._is_root is None or m._is_root == False
  if m._is_root is None:
      m._is_root = False
      if not self._has_params:
          assert m._queue_wait_for_post_backward_closure is None
          m._queue_wait_for_post_backward_closure = self._queue_wait_for_post_backward

the above minimal example passed

Here is a minimal reproducible example:

Sounds like we may want to relax some constrains in FSDP. Will need to take a closer look when I can find time.

@SeanNaren , @min-xu-ai , looks like modifying this piece https://github.com/facebookresearch/fairscale/blob/b0e6b9bdeb4270f600ef242b1b1f97f4a61e0a42/fairscale/nn/data_parallel/fully_sharded_data_parallel.py#L850-L859
to
  assert m._is_root is None or m._is_root == False
  if m._is_root is None:
      m._is_root = False
      if not self._has_params:
          assert m._queue_wait_for_post_backward_closure is None
          m._queue_wait_for_post_backward_closure = self._queue_wait_for_post_backward

the above minimal example passed

Thanks for checking this @shuyingsunshine21!!
Thanks for digging into this and finding this fix, I think if the fairscale team are fine with it, we can change this assertion. It makes sense since the model has already been nested with FSDP wrappers and initialized, the question is if it will run fine if we wrap it again (buffers are already flattened, but I think that shouldn't matter)

Here is a minimal reproducible example:

Sounds like we may want to relax some constrains in FSDP. Will need to take a closer look when I can find time.

@SeanNaren , @min-xu-ai , looks like modifying this piece https://github.com/facebookresearch/fairscale/blob/b0e6b9bdeb4270f600ef242b1b1f97f4a61e0a42/fairscale/nn/data_parallel/fully_sharded_data_parallel.py#L850-L859
to
  assert m._is_root is None or m._is_root == False
  if m._is_root is None:
      m._is_root = False
      if not self._has_params:
          assert m._queue_wait_for_post_backward_closure is None
          m._queue_wait_for_post_backward_closure = self._queue_wait_for_post_backward

the above minimal example passed

Thanks @shuyingsunshine21! I like the relaxed assert. I think it allows the non-root to be set already, which is safer than allow root to be set and re-set for sure. Can you open an PR on fairscale repo? You may need to fork it and send a PR. We want to make sure the CI tests are fine with the new assert too.

Here is a minimal reproducible example:

Sounds like we may want to relax some constrains in FSDP. Will need to take a closer look when I can find time.

@SeanNaren , @min-xu-ai , looks like modifying this piece https://github.com/facebookresearch/fairscale/blob/b0e6b9bdeb4270f600ef242b1b1f97f4a61e0a42/fairscale/nn/data_parallel/fully_sharded_data_parallel.py#L850-L859
to
  assert m._is_root is None or m._is_root == False
  if m._is_root is None:
      m._is_root = False
      if not self._has_params:
          assert m._queue_wait_for_post_backward_closure is None
          m._queue_wait_for_post_backward_closure = self._queue_wait_for_post_backward

the above minimal example passed

Thanks @shuyingsunshine21! I like the relaxed assert. I think it allows the non-root to be set already, which is safer than allow root to be set and re-set for sure. Can you open an PR on fairscale repo? You may need to fork it and send a PR. We want to make sure the CI tests are fine with the new assert too.

Sure, let me do it.

@SeanNaren thank you for working on the FSDP integration. I wonder if you have/plan to benchmark it against deepspeed, eg. via https://github.com/SeanNaren/minGPT/?

@leezu absolutely :) I really want to work with the FairScale team to get the FSDP integration right and looking reasonable first, but this will be the first thing I want to do!
I also want to make it clear that there is no free lunch; using these techniques are great to scale, however depending on how memory efficient you want it to be, speed becomes a tradeoff.

@SeanNaren , @min-xu-ai , @ananthsub , I was testing FSDP with FP16 for multi-label classification task using XLMR encoder, but it crashes for optimizer step.
Here is the minimal repro model:
import torch
import torch.nn.functional as F
import torchmetrics as metrics

# from fairscale.nn import wrap
from pytorch_lightning import Trainer, LightningModule, LightningDataModule
from pytorch_lightning.plugins import FullyShardedPlugin
from torch.nn import Linear, ReLU, Sequential, BCEWithLogitsLoss
from torch.utils.data import DataLoader, Dataset

class RandomDataTensor:
    def __init__(self, size, length, num_classes):
        self.data = torch.randn(length, size)
        # multi-class label
        self.label = torch.zeros([length, num_classes])
        for i in range(length):
            self.label[i][torch.randint(num_classes, (3,))] = 1

class RandomDataset(Dataset):
    def __init__(self, random_data_tensor):
        self.len = random_data_tensor.data.shape[0]
        self.data = random_data_tensor.data
        self.label = random_data_tensor.label

    def __getitem__(self, index):
        return {"sample": self.data[index], "label": self.label[index]}

    def __len__(self):
        return self.len

class BoringModel(LightningModule):
    def __init__(self):
        super().__init__()
        self.num_classes = 10
        self.model = Sequential(
            Linear(32, 32),
            ReLU(),
            Linear(32, self.num_classes),
        )
        self.loss = BCEWithLogitsLoss()
        self.valid_acc = metrics.Accuracy()
        self.test_acc = metrics.Accuracy()
        self.optimizer = torch.optim.SGD(
            self.model.parameters(), lr=0.1,
        )

    def forward(self, batch):
        return self.model(batch["sample"])

    def training_step(self, batch, batch_idx):
        logits = self(batch)
        loss = self.loss(logits, batch["label"])
        return {"loss": loss}

    def validation_step(self, batch, batch_idx):
        logits = self(batch)
        loss = self.loss(logits, batch["label"])
        scores = F.softmax(logits)
        accuracy = (self.valid_acc(scores, batch["label"].int()),)
        # self.log("val_loss", loss, on_epoch=True, prog_bar=True)
        # self.log("val_accuracy", accuracy, on_epoch=True, prog_bar=True)

    def test_step(self, batch, batch_idx):
        logits = self(batch)
        loss = self.loss(logits, batch["label"])
        scores = F.softmax(logits)
        accuracy = (self.test_acc(scores, batch["label"].int()),)
        # self.log("test_loss", loss, on_epoch=True, prog_bar=True)
        # self.log("test_accuracy", accuracy, on_epoch=True, prog_bar=True)

    def configure_optimizers(self):
        lr_scheduler = torch.optim.lr_scheduler.StepLR(self.optimizer, step_size=1)
        return [self.optimizer], [lr_scheduler]

model = BoringModel()
data_module = LightningDataModule.from_datasets(
    train_dataset=RandomDataset(dataset_tensors["train"]),
    val_dataset=RandomDataset(dataset_tensors["val"]),
    test_dataset=RandomDataset(dataset_tensors["test"]),
    batch_size=16,
)
trainer = Trainer(
    gpus=1, max_epochs=1, precision=16, accelerator="ddp_fully_sharded"
)
trainer.fit(model, datamodule=data_module)

crashes with following error message
trainer.fit(model, datamodule=data_module)\n  File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/pytorch_lightning/trainer/trainer.py\", line 502, in fit
self.dispatch()\n  File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/pytorch_lightning/trainer/trainer.py\", line 545, in dispatch
self.accelerator.start_training(self)  File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/pytorch_lightning/accelerators/accelerator.py\", line 95, in start_training
self.training_type_plugin.start_training(trainer) File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/pytorch_lightning/plugins/training_type/training_type_plugin.py\", line 141, in start_training
self._results = trainer.run_stage() File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/pytorch_lightning/trainer/trainer.py\", line 557, in run_stage
self.run_train() File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/pytorch_lightning/trainer/trainer.py\", line 621, in run_train
self.train_loop.run_training_epoch() File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/pytorch_lightning/trainer/training_loop.py\", line 481, in run_training_epoch
batch_output = self.run_training_batch(batch, batch_idx, dataloader_idx) File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/pytorch_lightning/trainer/training_loop.py\", line 672, in run_training_batch
self.optimizer_step(optimizer, opt_idx, batch_idx, train_step_and_backward_closure) File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/pytorch_lightning/trainer/training_loop.py\", line 418, in optimizer_step
model_ref.optimizer_step File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/pytorch_lightning/core/lightning.py\", line 1371, in optimizer_step
optimizer.step(closure=optimizer_closure)\n  File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/pytorch_lightning/core/optimizer.py\", line 214, in step
self.__optimizer_step(*args, closure=closure, profiler_name=profiler_name, **kwargs) File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/pytorch_lightning/core/optimizer.py\", line 134, in __optimizer_step
trainer.accelerator.optimizer_step(optimizer, self._optimizer_idx, lambda_closure=closure, **kwargs)\n  File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/pytorch_lightning/accelerators/accelerator.py\", line 311, in optimizer_step
self.precision_plugin.post_optimizer_step(optimizer, opt_idx) File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/pytorch_lightning/plugins/precision/native_amp.py\", line 96, in post_optimizer_step
self.scaler.step(optimizer) File \"/mnt/xarfuse/uid-25729/5d4b24f2-seed-nspid4026533646_cgpid4526161-ns-4026533643/torch/cuda/amp/grad_scaler.py\", line 336, in step
assert len(optimizer_state[\"found_inf_per_device\"]) > 0, \"No inf checks were recorded for this optimizer

Thanks @shuyingsunshine21! Do you mind trying:
    def configure_optimizers(self):
        lr_scheduler = torch.optim.lr_scheduler.StepLR(self.optimizer, step_size=1)
        self.optimizer = torch.optim.SGD(
            self.trainer.model.parameters(), lr=0.1, # Ensure we use the wrapped FSDP model
        )
        return [optimizer], [lr_scheduler]

It isn't documented yet, but FSDP requires you to use the model wrapped in FSDP, with an issue to one day resolve this hopefully here: https://github.com/facebookresearch/fairscale/issues/430
In the documentation we will make it clear that you should use self.trainer.model and the original views of the weights are destroyed.

configure_optimizers

Thanks @SeanNaren , moving optimizer part to configure_optimizers works. Wonder why this trick is only special to FP16 only.

For some reason when the typing initiative was going on the model was removed from the precision plugin clip_gradients signature. My guess is that there was no use in the library at the current stage but it may have been added in an incremental step towards getting FSDP integrated.
https://github.com/PyTorchLightning/pytorch-lightning/commit/f29ecbfd909ff431ef837fcc8ebff451e897cb0b#diff-3facc0e73962d7c559c4257f0845ee7de30191a51017643c0f8f83bb0edb8a12L79 cc @carmocca in case there was another reason it was removed.
I've added this back in this PR and specified that it can be a torch.nn.Module as well, since the model could be wrapped.
@shubhamagarwal92 glad it fixed the issue! We'll definitely highlight in the docs. Let me know how your XLM experiments go!

Let me know how your XLM experiments go!

you might tag the wrong person. will let you know (testing now)
for the clip_gradients signature part, was also about to raise that as well, found that when I rebase

has another question, as FSDP wrap the whole lightning module, when we setup metrics (where the metric class has tensor fields) in the module. When using FP16, that would be converted to float16 also, this would cause some problem where the metric computation make use of it and some other metrics computing on the fly which are of type float32.
is there a workaround for not casting those to float16?
import torch
import torch.nn.functional as F
import torchmetrics as metrics

# from fairscale.nn import wrap
from pytorch_lightning import Trainer, LightningModule, LightningDataModule
from pytorch_lightning.plugins import FullyShardedPlugin
from torch.nn import Linear, ReLU, Sequential, BCEWithLogitsLoss
from torch.utils.data import DataLoader, Dataset

class RandomDataTensor:
    def __init__(self, size, length, num_classes):
        self.data = torch.randn(length, size)
        # multi-class label
        self.label = torch.zeros([length, num_classes])
        for i in range(length):
            self.label[i][torch.randint(num_classes, (3,))] = 1

class RandomDataset(Dataset):
    def __init__(self, random_data_tensor):
        self.len = random_data_tensor.data.shape[0]
        self.data = random_data_tensor.data
        self.label = random_data_tensor.label

    def __getitem__(self, index):
        return {"sample": self.data[index], "label": self.label[index]}

    def __len__(self):
        return self.len

class BoringModel(LightningModule):
    def __init__(self):
        super().__init__()
        self.num_classes = 10
        self.model = Sequential(
            Linear(32, 32),
            ReLU(),
            Linear(32, self.num_classes),
        )
        self.loss = BCEWithLogitsLoss()
        self.model_unrelated_parameter = torch.ones(3, 5, dtype=torch.float32)

    def training_step(self, batch, batch_idx):
        logits = self(batch)
        loss = self.loss(logits, batch["label"])
        return {"loss": loss}

    def configure_optimizers(self):
        self.optimizer = torch.optim.SGD(
            self.trainer.model.parameters(),
            lr=0.1,
        )
        lr_scheduler = torch.optim.lr_scheduler.StepLR(self.optimizer, step_size=1)
        return [self.optimizer], [lr_scheduler]

    def on_train_start(self):
        assert self.model_unrelated_parameter.dtype == torch.float32.  <--- here the model_unrelated_parameter type is float16 for ddp_fully_sharded

model = BoringModel()
data_module = LightningDataModule.from_datasets(
    train_dataset=RandomDataset(dataset_tensors["train"]),
    val_dataset=RandomDataset(dataset_tensors["val"]),
    test_dataset=RandomDataset(dataset_tensors["test"]),
    batch_size=16,
)
trainer = Trainer(
    gpus=1, max_epochs=1, precision=16, accelerator="ddp_fully_sharded"
)
trainer.fit(model, datamodule=data_module)

as pointed above, the assertion in on_train_start fails. (Note that the assertion is true for ddp and ddp_sharded)

@shuyingsunshine21 I'm not able to reproduce this, there were a few missing definitions in your example so I made a new one:
import torch
from pytorch_lightning import Trainer, LightningModule
from torch.utils.data import DataLoader, Dataset

class RandomDataset(Dataset):

    def __init__(self, size, length):
        self.len = length
        self.data = torch.randn(length, size)

    def __getitem__(self, index):
        return self.data[index]

    def __len__(self):
        return self.len

class BoringModel(LightningModule):

    def __init__(self):
        super().__init__()
        self.layer = torch.nn.Sequential(
            torch.nn.Linear(32, 32),
            torch.nn.ReLU(),
            torch.nn.Linear(32, 2)
        )
        self.model_unrelated_parameter = torch.ones(3, 5, dtype=torch.float32)

    def forward(self, x):
        return self.layer(x)

    def loss(self, batch, prediction):
        # An arbitrary loss to have a loss that updates the model weights during `Trainer.fit` calls
        return torch.nn.functional.mse_loss(prediction, torch.ones_like(prediction))

    def training_step(self, batch, batch_idx):
        output = self(batch)
        loss = self.loss(batch, output)
        return {"loss": loss}

    def validation_step(self, batch, batch_idx):
        output = self(batch)
        loss = self.loss(batch, output)
        return {"x": loss}

    def test_step(self, batch, batch_idx):
        output = self(batch)
        loss = self.loss(batch, output)
        return {"y": loss}

    def configure_optimizers(self):
        optimizer = torch.optim.SGD(self.trainer.model.parameters(), lr=0.1)
        lr_scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=1)
        return [optimizer], [lr_scheduler]

    def train_dataloader(self):
        return DataLoader(RandomDataset(32, 64))

    def val_dataloader(self):
        return DataLoader(RandomDataset(32, 64))

    def test_dataloader(self):
        return DataLoader(RandomDataset(32, 64))

    def on_train_start(self):
        assert self.model_unrelated_parameter.dtype == torch.float32

if __name__ == '__main__':
    model = BoringModel()
    trainer = Trainer(
        max_epochs=1,
        gpus=1,
        precision=16,
        plugins='ddp_fully_sharded'
    )
    trainer.fit(model)
    trainer.test(model)

This runs fine, and the assertion passes, is there something missing from the above that I omitted?

@SeanNaren , my bad, you are right, the above example is not correct. Let me re-paste, just add TestMetric on top of your example
from torchmetrics import Metric
import torch
from pytorch_lightning import Trainer, LightningModule
from torch.utils.data import DataLoader, Dataset

class TestMetric(Metric):

    thresholds: torch.Tensor

    def __init__(
        self,
        num_thresholds: int = 100,
        compute_on_step: bool = False,
        **kwargs
    ) -> None:
        super().__init__(compute_on_step=compute_on_step, **kwargs)
        self.num_thresholds = num_thresholds
        thresholds = torch.arange(num_thresholds) / num_thresholds
        self.register_buffer("thresholds", thresholds)
        assert self.thresholds.dtype == torch.float32 # <- this part is fine

    def update(self, output: torch.Tensor) -> None:
        assert self.thresholds.dtype == torch.float32 # <- this breaks for fully sharded
        self.predictions = torch.rand((1 , self.num_thresholds), device=output.device)

    def compute(self) -> torch.Tensor:
        assert self.thresholds.dtype == torch.float32 # <- this breaks for fully sharded
        condition = self.predictions >= 0.5  # <- this is float32
        thresholds_at_p = (
            torch.where(
                condition, self.thresholds, torch.scalar_tensor(1e6, device=condition.device)
            )
            .min(dim=1)
            .values
        ) # <- as a result, this computation would fail for fully sharded
        return thresholds_at_p

class RandomDataset(Dataset):

    def __init__(self, size, length):
        self.len = length
        self.data = torch.randn(length, size)

    def __getitem__(self, index):
        return self.data[index]

    def __len__(self):
        return self.len

class BoringModel(LightningModule):

    def __init__(self):
        super().__init__()
        self.layer = torch.nn.Sequential(
            torch.nn.Linear(32, 32),
            torch.nn.ReLU(),
            torch.nn.Linear(32, 2)
        )
        self.val_test_metric = TestMetric(num_thresholds=100)

    def forward(self, x):
        return self.layer(x)

    def loss(self, batch, prediction):
        # An arbitrary loss to have a loss that updates the model weights during `Trainer.fit` calls
        return torch.nn.functional.mse_loss(prediction, torch.ones_like(prediction))

    def training_step(self, batch, batch_idx):
        output = self(batch)
        loss = self.loss(batch, output)
        return {"loss": loss}

    def validation_step(self, batch, batch_idx):
        output = self(batch)
        loss = self.loss(batch, output)
        self.val_test_metric(output)
        return {"x": loss}

    def on_validation_epoch_end(self):
        self.val_test_metric.compute()

    def test_step(self, batch, batch_idx):
        output = self(batch)
        loss = self.loss(batch, output)

        return {"y": loss}

    def configure_optimizers(self):
        optimizer = torch.optim.SGD(self.trainer.model.parameters(), lr=0.1)
        lr_scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=1)
        return [optimizer], [lr_scheduler]

    def train_dataloader(self):
        return DataLoader(RandomDataset(32, 64))

    def val_dataloader(self):
        return DataLoader(RandomDataset(32, 64))

    def test_dataloader(self):
        return DataLoader(RandomDataset(32, 64))

if __name__ == '__main__':
    model = BoringModel()
    trainer = Trainer(
        max_epochs=1,
        gpus=1,
        precision=16,
        plugins='ddp_fully_sharded'
    )
    trainer.fit(model)
    trainer.test(model)

Note: tested the above for ddp and ddp_sharded,  works.

Thanks @shuyingsunshine21 we can iterate on this!
Another bug I've run into which will block this PR heavily is that the parameters are not kept when going from trainer.fit(model) to trainer.test(model) in the same session.
This is because with flatten_parameters we create a FlattenParamsWrapper that contains all the parameters, and when we move to the next stage, we do not bring the FlattenParamsWrapper parameters with us since we're still referring to the old model.
I think the cleanest fix would be at teardown or after training has finished, we unflatten the parameters back to the original model. Is this doable @min-xu-ai via _unflatten_params? I haven't experimented too much with it but it seems it does what I'm suggesting!

I am closing this in favour of https://github.com/PyTorchLightning/pytorch-lightning/pull/7487
Remaining is the ability to auto wrap the model so users do not have to manually annotate layers. This will come in followup PRs once we figure out the case :)


Humidifier zhimi.humidifier.ca4 after update to  v0.5.5 - missed "physical-controls-locked"

Hello,
after update to version v0.5.5
missed "physical-controls-locked"

Thank you.

Upgrade to master branch.

Thanks a lot. All work.


Update elastix to current version

@lassoan I can to the specific hash instead of master if that is preferable.

Thank you!
It seems that they have a "develop" branch, so hopefully the "master" branch will be stable enough for us.


doc: fix misspellings in Kconfig files

occasional spelling-check scan found some misspellings
Signed-off-by: David B. Kinder<EMAIL_ADDRESS>

Codecov Report

Merging #6954 into master will increase coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #6954      +/-   ##
==========================================
+ Coverage   55.63%   55.63%   +<.01%
==========================================
  Files         462      462
  Lines       44567    44567
  Branches     8296     8296
==========================================
+ Hits        24794    24795       +1
+ Misses      16381    16380       -1
  Partials     3392     3392

Impacted Files
Coverage Δ

lib/posix/pthread.c
69.84% <0%> (+0.5%)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b78225...477a5c5. Read the comment docs.


Create baidu-translate.coffee

Allows Hubot to translate en to zh.cn languages using fanyi.baidu.com for free

We are actually moving away from adding scripts to repository in favor of separate npm packages per scripts. See #1113 for details, and let us know if you have any questions about getting going with that!


MM-13566 - Added .length to Set and Map

Added .length to Set and Map prototypes

Added eslint no-extend-native exception to allow Set and Map extensions

Only if EnableDeveloper is true of course

https://mattermost.atlassian.net/browse/MM-13566

[x] Ran make check-style to check for style errors (required for all pull requests)
[x] Ran make test to ensure unit and component tests passed

Thanks @steveperjesi for the pull request!
Per the CONTRIBUTING.md file displayed when you created this pull request, we need to add you to the list of approved contributors for the Mattermost project.
Please help complete the Mattermost contribution license agreement?
This is a standard procedure for many open source projects. Your form should be processed within 24 hours and reviewers for your pull request will be able to proceed.
Please let us know if you have any questions.
We are very happy to have you join our growing community! If you're not yet a member, please consider joining our Contributors community channel to meet other contributors and discuss new opportunities with the core team.

Hi @steveperjesi, any thoughts on @lieut-data's suggestions? Let us know if you need any help

Hey @steveperjesi,
Do you have questions about the above provided feedback?
Please note that we will close this PR after another 30 days of inactivity. If you don't object, other contributors might complete this PR for you.

@steveperjesi, thanks for taking a look at this one. We have another community member looking to give this one a stab, so I'm going to close this PR out early. Feel free to find another issue to tackle when you another chance to contribute :)


When I refresh the screen the search field is off the page

Rancher versions: 2.0 master 1/31
Steps to Reproduce:

Log into rancher
Refresh the browser (try a couple of time if it doesn't do it first time

Results:  the search field for clusters is way off the page and to the right.  You can tell because a scrollbar appears on the bottom.  Scroll all the way to the right and you will see the search field.

Hi @tfiduccia , do you still see this issue in current version? I can not recreate this issue.

@tfiduccia can you try reproducing?

Version - 2.0 master 4/27
I can no longer reproduce.


Update TF examples to Keras V3

What happened?
We updated the TF examples to use TF-V2 (#2015), but as described here, as a workaround it uses Keras V2.
We need to verify whether the code can be adapted to work with Keras V3.
What did you expect to happen?
TensorFlow examples are executed using Keras V3
Impacted by this bug?
Give it a 👍 We prioritize the issues with most 👍

/remove-label lifecycle/needs-triage


The border of the Google Play badge is not perfect

I think that enabling the old white margin again will hide the imperfection 😌

For the Google Play badge, I've used the official one.
I think it's a problem when scaling it...
Let me assign me this issue as I removed the white border.
Will do some tests and share the results here!

Great! Don't hurry! Right now it's not perfect, but it's good 😘
On Thu, 1 Feb 2018 at 09:10, Esteve Aguilera<EMAIL_ADDRESS>wrote:

For the Google Play badge, I've used the official one.
I think it's a problem when scaling it...
Let me assign me this issue as I removed the white border.
Will do some tests and share the results here!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Fewlaps/quitnow-website/issues/18#issuecomment-362178180,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAb3M5Jwgm7TPVMxUNAFlvom7HkXq69kks5tQWNxgaJpZM4R1JK2
.

--
Roc Boronat
https://rocboron.at
Escrit des del mòbil. Disculpa la brevetat i les possibles faltes
ortogràfiques.

I've just enabled the white border again, and it still does not fit the image sizes...
After playing a little bit with the CSS I feel like I've no idea what I am doing 😅
It will take me more time than expected

Hahahaha we may share pictures of us when dealing with css!
On Thu, 1 Feb 2018 at 14:49, Esteve Aguilera<EMAIL_ADDRESS>wrote:

I've just enabled the white border again, and it still does not fit the
image sizes...
After playing a little bit with the CSS I feel like I've no idea what I am
doing 😅
It will take me more time than expected
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Fewlaps/quitnow-website/issues/18#issuecomment-362256331,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAb3M7XDoSvJLMYrt9O_nQNIvHGry_SHks5tQbLygaJpZM4R1JK2
.

--
Roc Boronat
https://rocboron.at
Escrit des del mòbil. Disculpa la brevetat i les possibles faltes
ortogràfiques.


Add WIFI from QR code

Is your feature request related to a problem? Please describe.
no
Describe the solution you'd like
when you scan a QR code with wifi data with native camera it offers to connect to wifi
WIFI:T:WPA;S:myHome;P:12345678;H:false;

In my honest opinion this is outside the scope of this package. If someone would like to connect to a WIFI spot through a QRcode they would use their native QR scanner. However, if you want to add such capability to your app, you should implement that yourself. On Android you could start by looking at this SO issue: https://stackoverflow.com/questions/8818290/how-do-i-connect-to-a-specific-wi-fi-network-in-android-programmatically

However, I will keep track of this and similar issues. If it receives enough attention I will consider implementing it. And of course you could always submit a PR yourself.

On further research, I think I agree with you, it doesn't belong in your
package, I should use something like WifiWizard2.
I am probably not qualified to do the native side here. WifiWizard2 is not
being updated anymore. My company offered to pay him to update it... but no
response... oh well. I'll think I will have to solve this another way... in
all cases, thanks for your prompt response, and valuable feedback.
On Tue, 16 Mar 2021 at 16:20, Tafel @.***> wrote:

However, I will keep track of this and similar issues. If it receives
enough attention I will consider implementing it. And of course you could
always submit a PR yourself.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/capacitor-community/barcode-scanner/issues/21#issuecomment-800299701,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAWLV7CBGDMQJAGNW4D5WOLTD5SJZANCNFSM4ZGXODSQ
.

#211

#21


Changes to Unit Template (resolves issue #196)

Moved the function Invoke-TestCleanup and Invoke-TestSetup to before the try-catch-block.
Made some minor style changes where I found extra blank lines and missing blank lines.

This resolves isssue #196

This change is

Hi @johlju, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
The agreement was validated by Microsoft and real humans are currently evaluating your PR.
TTYL, MSBOT;

Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.

Comments from Reviewable


sigal: 1.4.0 -> 1.4.1

Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools. This update was made based on information from https://repology.org/metapackage/sigal/versions.
meta.description for sigal is: '"Yet another simple static gallery generator"'.

Checks done (click to expand)

built on NixOS
/nix/store/hgmfrfymg46kx55zp948h21sysg1iw56-sigal-1.4.1/bin/.sigal-wrapped passed the binary check.
/nix/store/hgmfrfymg46kx55zp948h21sysg1iw56-sigal-1.4.1/bin/sigal passed the binary check.
2 of 2 passed binary check by having a zero exit code.
2 of 2 passed binary check by having the new version present in output.
found 1.4.1 with grep in /nix/store/hgmfrfymg46kx55zp948h21sysg1iw56-sigal-1.4.1
directory tree listing: https://gist.github.com/d0a2027d6dfc97da9532f81ace30cb1b
du listing: https://gist.github.com/20cae6d83e3234bd37a1155d7e7d0a46

Instructions to test this update (click to expand)

One-time optional setup to skip building using Cachix:
nix-shell -p cachix --run 'cachix use r-ryantm'

Test this update by entering a nix shell, seeing what is inside the
result, and if applicable, running some binaries:
nix-shell --pure -I nixpkgs=https://github.com/r-ryantm/nixpkgs/archive/abbc7ea10f35491b0f1cb871ab8a038f23ca2fa8.tar.gz -p sigal
ls -la /nix/store/hgmfrfymg46kx55zp948h21sysg1iw56-sigal-1.4.1

cc @domenkozar for testing.

Success on x86_64-linux (full log)
Attempted: sigal
Partial log (click to expand)
Successfully installed sigal-1.4.1
/build/sigal-1.4.1
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/hgmfrfymg46kx55zp948h21sysg1iw56-sigal-1.4.1
strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/hgmfrfymg46kx55zp948h21sysg1iw56-sigal-1.4.1/lib  /nix/store/hgmfrfymg46kx55zp948h21sysg1iw56-sigal-1.4.1/bin
patching script interpreter paths in /nix/store/hgmfrfymg46kx55zp948h21sysg1iw56-sigal-1.4.1
checking for references to /build in /nix/store/hgmfrfymg46kx55zp948h21sysg1iw56-sigal-1.4.1...
wrapping `/nix/store/hgmfrfymg46kx55zp948h21sysg1iw56-sigal-1.4.1/bin/sigal'...
pytestcachePhase

Success on x86_64-darwin (full log)
Attempted: sigal
Partial log (click to expand)
  The script sigal is installed in '/nix/store/vpcc9vvaxzhgxa8lwgwx3xdcx325afhv-sigal-1.4.1/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed sigal-1.4.1
/private/tmp/nix-build-sigal-1.4.1.drv-0/sigal-1.4.1
post-installation fixup
strip is /nix/store/53nysl8bqwxihwzs1pgwka20nf8mbvlp-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/vpcc9vvaxzhgxa8lwgwx3xdcx325afhv-sigal-1.4.1/lib  /nix/store/vpcc9vvaxzhgxa8lwgwx3xdcx325afhv-sigal-1.4.1/bin
patching script interpreter paths in /nix/store/vpcc9vvaxzhgxa8lwgwx3xdcx325afhv-sigal-1.4.1
wrapping `/nix/store/vpcc9vvaxzhgxa8lwgwx3xdcx325afhv-sigal-1.4.1/bin/sigal'...
pytestcachePhase

Success on aarch64-linux (full log)
Attempted: sigal
Partial log (click to expand)
/build/sigal-1.4.1
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/zh5fkw4w6cpc1ln0imc4cgb5s1zlwjsa-sigal-1.4.1
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/zh5fkw4w6cpc1ln0imc4cgb5s1zlwjsa-sigal-1.4.1/lib  /nix/store/zh5fkw4w6cpc1ln0imc4cgb5s1zlwjsa-sigal-1.4.1/bin
patching script interpreter paths in /nix/store/zh5fkw4w6cpc1ln0imc4cgb5s1zlwjsa-sigal-1.4.1
checking for references to /build in /nix/store/zh5fkw4w6cpc1ln0imc4cgb5s1zlwjsa-sigal-1.4.1...
wrapping `/nix/store/zh5fkw4w6cpc1ln0imc4cgb5s1zlwjsa-sigal-1.4.1/bin/sigal'...
pytestcachePhase
/nix/store/zh5fkw4w6cpc1ln0imc4cgb5s1zlwjsa-sigal-1.4.1


Rename FulfillmentNotInValidBlock to TransactionNotInValidBlock

A minor pull request that renames the exception FulfillmentNotInValidBlock to TransactionNotInValidBlock.
The new name is in line with the name of the exception TransactionDoesNotExist (which serves a similar purpose).
I also added TransactionNotInValidBlock to the list of exceptions that Transaction.validate() can raise (i.e. in that method's docstring).

Current coverage is 96.44% (diff: 100%)

Merging #765 into master will not change coverage

@@             master       #765   diff @@
==========================================
  Files            25         25
  Lines          1602       1602
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
  Hits           1545       1545
  Misses           57         57
  Partials          0          0

Powered by Codecov. Last update bd12972...2d6dfaa

:+1:

Sorry I missed this


Support for placeholder templater

Hi,
Would it be possible to add support for custom palceholder templaters  similar to how sqlfluff does
[sqlfluff:templater:placeholder]
param_regex = __(?P<param_name>[\w_]+)__
my_name = 'john'

Hey @ashish10alex,
Just pushed a pr with this implementation for you, so hopefully with you soon.

There's still a little more work than expected but the templater is defined.

Can we close this?

I think let's just push a build before declaring it done.

Pushed to brew so will close. @ashish10alex  let us know if you need anything else.


es6 doesn't compile classes

If i compile with "target: 'es5'" everything works fine.
But if i switch to es6, my ts files are not being compiled, even though files are generate.
Can you help me with this? I wanted to encapsule my whole project into a module so i wont interfere with any other js file that may be uses as well.
Thanks.

yeah same problem here, es5 creates files just fine but es6 does not generate any file

In my case it does create files but the new "js" file still has classes,...

That should be fine as ES6 really supports classes

Currently I use a custom grunt task for that:
`
grunt.registerTask('typescript-server', 'compile app and tests', function() {
var done = this.async();
grunt.util.spawn({
  grunt: false,
  cmd: "tsc",
  args: ["-p", "./src/server", "-sourcemap"],
  opts: {
    stdio: "inherit"
  }
}, function(err, result, stderr) {
  grunt.log.ok('successfully transpiled typescript (server)!');
  done();
});

});
`

I know it's been a while, sorry. I think we can close this ;)


Added case for '\r'

When trying to parse PO file with strings containing "\r\n" there's an error "Escape sequence is invalid at". But I believe it's a valid case, PO files can also be generated/used on Windows, hence I've added it.

Hi!
Thanks for the suggestion. However, it doesn't seem like a good idea to me. Allowing platform-dependent new lines in PO string literals would complicate new line handling pretty much.
The specification which this library is based on isn't particularly clear on this question. Poedit uses \n for new lines even on Windows.
In my opinion, it's better to use a platform-independent encoding for storage and transform the new line characters when loading the file. As a matter of fact, this is already supported: StringDecodingOptions provide full control over the new line decoding behavior. (See also this discussion).

Sorry for replying so late. Unfortunately proposed solution doesn't help in my case and I need to replace "\r\n" with "\r\n" in PO file before parsing it via your library. Hence my PR.

After giving some more thought to the problem, I came to the conclusion that it's ok to accept other line terminator sequences than '\n' during parsing. (This doesn't interfere with StringDecodingOptions which determine what newline sequence to use in the decoded strings.) Writing back PO content to file will be done with '\n'. This corresponds to the behavior of POEdit.
I'm going to merge this change now and release a new version containing it soon.

Version 1.9.0 is now available on NuGet.


edX to Open edX App Data Migration Path

Goal:
edX mobile team to get a working internal build of the new open edx mobile applications to confirm feature gap list scope, theming capabilities, data migration needs, and more.
Potential scope draft:

edX mobile team to have a build of the new applications powered with their data
Confirm migration / data path
Confirm theming capabilities etc.

Outcomes:

Further debugging and triage process for gaps sooner rather than later

....
Step 1 - Devop Alignment

Hey @marcotuts , @volodymyr-chekyrta  considering the current implementation for the Android app, applying branding to the existing code can be achieved using native approaches. Our app currently supports two themes: LightMode and DarkMode. To accommodate multiple branding options, we can create various themes within the app and configure the following properties to match the desired theme:

Color Scheme
Fonts
Image Resources

We have the flexibility to define as many themes as necessary and create a Dark Mode variant accordingly.
However, it's important to note that modifying the designated folders for fonts and image resources is a relatively straightforward task. On the other hand, adjusting the color scheme requires a more extensive overhaul of the existing implementation. Currently, the color scheme is defined alongside fonts and shapes in a theme file. To make the rebranding process more manageable, we propose relocating the color definitions to a separate constant file and referencing them from there.
Furthermore, there are multiple instances within the app where hard-coded values are used instead of the dynamic values provided by the theme. This could pose challenges during the rebranding process.
In addition to these changes, we should establish a structured approach for dimension values. Currently, there's no standardized practice for utilizing dynamic values. Each view depends on hard-coded dimension values, primarily for padding, margins, buttons, layout/view creation, and shapes like rounded corners, among others.
To provide a clear visual representation of the app after the rebranding process, we have updated the color scheme, fonts, and image resources following the approach mentioned above.

Current Open edX App
Rebranding -> Color, fonts & Images

Pasting iOS team's findings here as well.
Multiple colors and images
App main colors and images are being used from the assets of the Core framework. At the moment, it will be a bit hard for someone to directly replace the colors of the app in the assets because maintaining the change set will require extra effort as it contains data for other images and icons. And some colors, like white, are hardcoded in the codebase.
Some images have a tinted color as well, like, for example, blue for the back arrow that is being used in the navbar. It will make changing a theme a bit harder and will require icon/image changes as well.
Recommendation:
It would be nice if another assets folder named Configurable Assets would be created in the Core framework, which would contain only the configurable items like colors, logos, auth colors, etc. All the colors should be used through the assets and theme classes.
The images that are being used in the navbar or bottom bar shouldn’t have any tinted color and the main theme color should be applied while using the icon so it matches the main theme color.
Fonts
Although fonts are being used through the theme class, and the parsing of fonts is also being done in the theme class. A code-level change (theme class parsing update) will be required to use different fonts.
Recommendation:
The basic part of the fonts parsing can be moved to a separate key-value based file, like in a JSON file, where the names of the fonts can be changed as per the font file, like
"regular":"Inter-Regular". It will make the fonts changes easy and the code level changes free.
Icons and splash screen
The asset folder of the target OpenedX can be replaced with a new one to change the icons and splash screen.
Recommendation:
There isn’t any change to make here; the existing architecture is configurable.

Update: Axinite will work to incorporate the recommendations in the app. Tickets for this work to be created soon.
FYI: @touchapp @marcotuts @volodymyr-chekyrta @miankhalid please review the findings and share feedback. We can also discuss this in our Technical Check-in call on Monday.

At this point it seems some tickets / improvements are coming in relating to this work - Is there an edx app build that could eventually be shared out with some of the wg-mobile team members once it exists? It would be helpful to be able to see a built via testflight or whenever ready as a contrast with the existing open edx app to do a live comparison in the themes but also to compare against the edX app (once ready - don't know how close we are to this - @moiz994

@marcotuts currently, we're just implementing the ability to update the theme of the app easily. We will work on the edX them of the app a little later in time but be happy to share that once it is ready.

Any update here on how close we think we are on this data migration / theme push?

@miankhalid & @touchapp can share more details on the data migration.
As for the theme, I believe we've merged theming capabilities work.

This may be close to ready to mark complete? The testflight build and theme customization seem done but will keep this epic open until we have confirmed this is ok to close.

@marcotuts yes, theme is almost done. It's finalized on iOS but now Android team needs to implement what was finalized on iOS.
Also, I still don't know what is the way forward in terms of the data migration. @miankhalid @touchapp need your help and updates on this.

@miankhalid @moiz994 @marcotuts Following are my findings on the data migration from edX to open edX
Android:

On upgrading from edX to open edX (New App) the user gets logged out
On upgrading all the downloaded videos get deleted
On upgrading the app the Calendar is not synced with the course date
Calendar Sync: When a user enables the calendar sync toggle then 2 events are created for the same course in the device’s calendar
On upgrading the app the IAP, upgrade content is not yet available

iOS:

On upgrading from edX to open edX (New App) the user gets logged out
On upgrading all the downloaded videos get deleted
On upgrading the app the Calendar is not synced with the course date
Calendar Sync: When a user enables the calendar sync toggle then there are no duplicate events create
On upgrading the app the IAP, upgrade content is not yet available

Note: I have also created the issue for this which is mentioned above

With the findings above, are we ok to close this epic out @miankhalid  / @moiz994 ? Or keep open a bit longer until the findings are explored / reviewed?


move from curl to reqwest

Fixes #60

Apparently this breaks rust 1.28 support. How important is that?

Taking 1.31 once that is released sounds very good to me. reqwest isn't that old yet, yes, but really nice to use.

I don't understand the CI failure here.. The log line shouldn't change anything about the behavior when updating the cache, and the previous commit passed those tests.

@jcgruenhage since you run the command inside the debug!() macro, it is not executed when debug logs are not enabled :smiley:
Solution: Assign the number of bytes to a variable and log that.

Oh, okay.

Interesting, github now shows force pushes. Neat!

Interesting, github now shows force pushes. Neat!

Yeah, I noticed that too yesterday. Very nice.
Looks good now, thanks!

Merged in d9507007469c9be6c811ce820982c714bc2d2f26


Updating PR to master instead of live

Thank you @MaximRouiller

Docs Build status updates of commit 9f10df4:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

advocates/aysegul-yonet.yml
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching in the Docs contributor and Admin GuideSee the frequently asked questionsPost your question in the Docs support channel


[Feature]: 4D Attention Mask

🚀 The feature, motivation and pitch
I am workning on 4D attention mask input and LLM generateion process. Huggingface provides an interface for the 4D attention mask. Does vllm have any plan? https://github.com/huggingface/transformers/pull/27539
Alternatives
No response
Additional context
No response

AFAIK custom attention masks are not supported in optimize implementations of attention (FlashInfer, FlashAttention), so this wouldn't be possible without also incurring a dramatic drop in performance.

AFAIK custom attention masks are not supported in optimized implementations of attention (FlashInfer, FlashAttention), so this wouldn't be possible without also incurring a dramatic drop in performance.

Thanks for your reply, i might have to realize the function myself.


Target table

Put targets into a table.

BeforeAfter

bors r+

@rtzoeller CI passes, try re-run.

bors retry


nextcloud28: init at 28.0.0, nextcloud27: 27.1.4 -> 27.1.5, nextcloud26: 26.0.9 -> 26.0.10

Description of changes

Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[ ] sandbox = relaxed
[ ] sandbox = true

[x] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

Anything else that needs to be changed?

Also I am hitting https://github.com/nextcloud/server/issues/42254

Also I noticed that my desktop client started to sync external storages which crippled performance of my local lan and nextcloud. I couldn't find a bug report on this though.

I've deployed this to my instance and next to a new optional index I've hit the following which we should fix
This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them: bz2. For more details see the [documentation ↗](https://docs.nextcloud.com/server/28/go.php?to=admin-php-modules).

I added all recommended PHP packages.

Also pushed the updates of nc27/nc26 here.

Does @RaitoBezarius have some capacity to review this?
I'd probably wait until tomorrow (unless someone requests more time to review of course) and merge then.

Does @RaitoBezarius have some capacity to review this? I'd probably wait until tomorrow (unless someone requests more time to review of course) and merge then.

Testing now.


chore(package): update jQuery to version 3.3.1

Closes the following PRs:

https://github.com/krux/postscribe/pull/419
https://github.com/krux/postscribe/pull/424

Coverage remained the same at 89.298% when pulling 3de043699d5bad90e9dbdba8180d2258a3b8c6ac on jgreens/update-jquery into 74a971e2bf41067e5d3a9887fd515cdfc368dc09 on master.


TFTRT: Support GatherV2 op

Add support for GatherV2 Op.
Add unit tests
Add CheckAxis helper method (need to use in other functions, will issue separate PR for this)

https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/gather-v2
The "scalar indices" case is currently unsupported because we don't allow scalar tensors, but they are now supported in TRT 5.0+ or maybe earlier, need to double check (TRT calls these 0-D tensors). We will have to update our code to allow these tensors in order to allow this case to convert.
Will add support for constant (weight) indices with automatic weight -> tensor helper soon.

Hi @smit-hinsu, would you please help to take a look? Thanks.

Thanks @smit-hinsu, must have missed those.
I am a little concerned about the usability of the GetSpan() method (previously ToVector). It seems like a  Span<const T> cannot be implicitly convered to an std::vector<T>? This kinda defeats the point of the helper function because it would require an extra step to get an std::vector.

What kind of use-cases are you envisioning that would require std::vector?
absl::Span provides read-only view to the Tensor as long as the tensor is not destructed. Even if we convert it to std::vector, we won't be able to update content of the original Tensor and I expect absl::Span to be usable in places where std::vector would have been used.

It seems that some of the tests started failing after PR but I couldn't figure out the reason.
tensorflow/python/compiler/tensorrt:gpu_base_test and
tensorflow/python/compiler/tensorrt:gpu_conv2d_test
tensorflow/python/compiler/tensorrt:gpu_vgg_block_test
Trevor, could you take a look?

@smit-hinsu Thanks Smit, I will look into it.

@smit-hinsu That was a tricky one. I forgot a comma when adding "GatherV2" to the candidate_ops list, which caused it to merge with the string below, which was "Identity" making the op that we claimed to support called "GatherV2Identity".

The commit that added the comma did not show up internally for some reason and therefore I had to manually fix it. That worked but ended up making me author of the commit and did not give credit to you. Sorry about that.
https://github.com/tensorflow/tensorflow/commit/368674dfe253eef39537fcabbb675f12be47ab05

I tried to reopen and merge, but there is no diff.


Gdk can't find seats

A basic gtk window test on the compositor example fails for me with:

(gtk-test:16551): Gdk-CRITICAL **: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

Try this basic Gdk seat test:
#!/usr/bin/env python3

import gi
gi.require_version('Gdk', '3.0')
from gi.repository import Gdk

DISPLAY='wayland-1'

display = Gdk.Display().open(DISPLAY)
seat = display.get_default_seat()
seats = display.list_seats()

print(seat)
print(seats)

You'll see None as seat and an empty list as seats.
This returns seats on both weston and sway.

Gdk requires wl_data_device_manager in order to support wl_seat.
From gdk/wayland/gdkdisplay-wayland.c:
  else if (strcmp (interface, "wl_seat") == 0)
    {
      static const char *required_device_manager_globals[] = {
        "wl_compositor",
        "wl_data_device_manager",
        NULL
      };

      if (has_required_globals (display_wayland,
                                required_device_manager_globals))
        _gdk_wayland_display_add_seat (display_wayland, id, version);
      else
        {
          SeatAddedClosure *closure;

          closure = g_new0 (SeatAddedClosure, 1);
          closure->base.handler = seat_added_closure_run;
          closure->base.required_globals = required_device_manager_globals;
          closure->id = id;
          closure->version = version;
          postpone_on_globals_closure (display_wayland, &closure->base);
        }
    }

Wow, that's stupid.

I will implement it, ok?
Dealt with it quite a bit when working on wlc.

👍

fixed by #107


community: add KafkaChatMessageHistory

Add chat history store based on Kafka.
Files added:
libs/community/langchain_community/chat_message_histories/kafka.py
docs/docs/integrations/memory/kafka_chat_message_history.ipynb
New issue to be created for future improvement:

Async method implementation.
Message retrieval based on timestamp.
Support for other configs when connecting to cloud hosted Kafka (e.g. add api_key field)
Improve unit testing & integration testing.

Hi @baskaryan @ccurme @eyurtsev , could you please take a look at this PR to add chat message store based on Kafka ?
I will also create a follow up issue as mentioned in the PR description.

Hi @eyurtsev Gentle ping on this. When you get a chance, could you please review this PR ?  Thank you!

@changliu-0520 Sorry for the delay. Can you please update the doctoring for KafkaChatMessageHistory. You can look at the ChatOpenAI doctoring for a good example. Just make sure to include code blocks correctly

@isahers1 Thanks for the review. I've updated the docstring.  Please let me know if we need further changes.


Running pyMabed for detecting event but getting Error in time_slice???

@AdrienGuille
Hi Mr.Guille,
Based on your response in this issue https://github.com/AdrienGuille/pyMABED/issues/4, I've been created a dataset with multiple range of date with their tweets but again I've got error??
Please guide me for solving this issue.
Image of my error:

Also my .csv dataset :
input-data.txt
input-data.zip
Thanks.

Hi,
I'm sorry but I can't help you. Your issue is related to your data, not the implementation of MABED. I can see from your screen capture that you still have more time slices than tweets, which makes no sense for MABED. Also, a time slice should contain at least a thousand tweets, so that word frequency can estimated correctly. If you can't gather more data than what you have now, then you won't be able to run MABED. I recommend trying other methods, even though I'm not aware of any event detection method that would perform well on these data.
Adrien


"immutableReferences["Contracts"]" = false How is it defined?

Component
Forge
Have you ensured that all of these are up to date?

[X] Foundry
[ ] Foundryup

What version of Foundry are you on?
a170021b
What command(s) is the bug in?
forge build
Operating System
macOS (Apple Silicon)
Describe the bug
When I create a bindings file using contracts, it says immutableReferences[Contracts] = false. However, this contract has a constructor and has Immutable items. Why does this result occur?

binding file : Link
The file that binds the contract is Link.

MasterMinter contracts has constructor "_minterManager"
However, when I bind MasterMinter, immutableReferences["MasterMinter"] = false, why do I get this result?

Hello ! I wish to work on this!

Hello ! I wish to work on this!

sorry for late reply. Do you know the problem with this? @LukePereyra

Marking as unrelated, forge bind does not build bindings for go


Error After Download

Hi, Using 1.8.2 twitchleecher and I'm getting this error after finishing download with converting enable
Download task has been started!
TWITCH LEECHER INFO
Version: 1.8.2
VOD INFO
VOD ID: 891965995
Selected Quality: 1920x1080@30fps (Source)
Download Url: https://www.twitch.tv/videos/891965995
Crop Start: Yes (00:58:35)
Crop End: Yes (01:01:35)
OUTPUT INFO
Disable Conversion: No
Output File: D:\Videos\Captures\20210128_891965995_Music.mp4
FFMPEG Path: D:\Programas\TwitchLeecher-master\Twitch Leecher\ffmpeg.exe
Temporary Download Folder: C:\Users\haris\AppData\Local\Temp\TL_3c7ea7d5-6e50-4234-8fe8-1c006aa347be
ACCESS INFO
Token: %7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22chansub%22%3A%7B%22restricted_bitrates%22%3A%5B%5D%7D%2C%22device_id%22%3Anull%2C%22expires%22%3A1612085598%2C%22https_required%22%3Atrue%2C%22privileged%22%3Afalse%2C%22user_id%22%3Anull%2C%22version%22%3A2%2C%22vod_id%22%3A891965995%7D
Signature: 405ed73afaa41c233bce75cc54a254fe1bf3e9bb
Sub-Only: No
Privileged: No
Creating temporary download directory 'C:\Users\haris\AppData\Local\Temp\TL_3c7ea7d5-6e50-4234-8fe8-1c006aa347be'... done!
Retrieving m3u8 playlist urls for all VOD qualities... done!
https://d2nvs31859zcd8.cloudfront.net/333c43bdacdcfbf31731_a_couple_streams_41496491134_1611878332/chunked/index-dvr.m3u8
https://d2nvs31859zcd8.cloudfront.net/333c43bdacdcfbf31731_a_couple_streams_41496491134_1611878332/720p30/index-dvr.m3u8
https://d2nvs31859zcd8.cloudfront.net/333c43bdacdcfbf31731_a_couple_streams_41496491134_1611878332/480p30/index-dvr.m3u8
https://d2nvs31859zcd8.cloudfront.net/333c43bdacdcfbf31731_a_couple_streams_41496491134_1611878332/audio_only/index-dvr.m3u8
https://d2nvs31859zcd8.cloudfront.net/333c43bdacdcfbf31731_a_couple_streams_41496491134_1611878332/360p30/index-dvr.m3u8
https://d2nvs31859zcd8.cloudfront.net/333c43bdacdcfbf31731_a_couple_streams_41496491134_1611878332/160p30/index-dvr.m3u8
Playlist url for selected quality 1920x1080@30fps (Source) is https://d2nvs31859zcd8.cloudfront.net/333c43bdacdcfbf31731_a_couple_streams_41496491134_1611878332/chunked/index-dvr.m3u8
Retrieving playlist... done!
Parsing playlist... done!
Number of video chunks: 1213
Starting parallel video chunk download
Number of video chunks to download: 19
Maximum connection count: 10
Parallel video chunk download is running...
Download of all video chunks complete!
Merging all VOD parts into 'C:\Users\haris\AppData\Local\Temp\TL_3c7ea7d5-6e50-4234-8fe8-1c006aa347be\20210128_891965995_Music.ts'...
Executing 'D:\Programas\TwitchLeecher-master\Twitch Leecher\ffmpeg.exe' on 'C:\Users\haris\AppData\Local\Temp\TL_3c7ea7d5-6e50-4234-8fe8-1c006aa347be\20210128_891965995_Music.ts'...
Command line arguments: -y -ss 7.004 -i "C:\Users\haris\AppData\Local\Temp\TL_3c7ea7d5-6e50-4234-8fe8-1c006aa347be\20210128_891965995_Music.ts" -analyzeduration<PHONE_NUMBER> -probesize<PHONE_NUMBER> -c:v copy -c:a copy -t 180 "D:\Videos\Captures\20210128_891965995_Music.mp4"
ffmpeg version N-93529-g8e3b01e20e Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20190212
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil      56. 26.100 / 56. 26.100
libavcodec     58. 48.101 / 58. 48.101
libavformat    58. 26.101 / 58. 26.101
libavdevice    58.  7.100 / 58.  7.100
libavfilter     7. 48.100 /  7. 48.100
libswscale      5.  4.100 /  5.  4.100
libswresample   3.  4.100 /  3.  4.100
libpostproc    55.  4.100 / 55.  4.100
Input #0, mpegts, from 'C:\Users\haris\AppData\Local\Temp\TL_3c7ea7d5-6e50-4234-8fe8-1c006aa347be\20210128_891965995_Music.ts':
Duration: 00:03:10.00, start: 3575.263000, bitrate: 4502 kb/s
Program 1
Stream #0:0[0x100]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 185 kb/s
Stream #0:1[0x101]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
Stream #0:2[0x102]: Data: timed_id3 (ID3  / 0x20334449)
D:\Videos\Captures\20210128_891965995_Music.mp4: No such file or directory
Starting temporary download folder cleanup!
Deleting directory 'C:\Users\haris\AppData\Local\Temp\TL_3c7ea7d5-6e50-4234-8fe8-1c006aa347be'... done!
Download task ended with an error!
System.AggregateException: One or more errors occurred. ---> System.ApplicationException: An error occured while converting the video!
at TwitchLeecher.Services.Services.ProcessingService.ConvertVideo(Action1 log, Action1 setStatus, Action1 setProgress, Action1 setIsIndeterminate, String sourceFile, String outputFile, CropInfo cropInfo)
at TwitchLeecher.Services.Services.TwitchService.<>c__DisplayClass51_0.b__2()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.ApplicationException: An error occured while converting the video!
at TwitchLeecher.Services.Services.ProcessingService.ConvertVideo(Action1 log, Action1 setStatus, Action1 setProgress, Action1 setIsIndeterminate, String sourceFile, String outputFile, CropInfo cropInfo)
at TwitchLeecher.Services.Services.TwitchService.<>c__DisplayClass51_0.b__2()
at System.Threading.Tasks.Task.Execute()<---
And if I try to disable and download the whole video, this error appears
Download task has been started!
TWITCH LEECHER INFO
Version: 1.8.2
VOD INFO
VOD ID: 891965995
Selected Quality: 1920x1080@30fps (Source)
Download Url: https://www.twitch.tv/videos/891965995
Crop Start: No
Crop End: No
OUTPUT INFO
Disable Conversion: Yes
Output File: D:\Videos\Captures\20210128_891965995_Music.ts
FFMPEG Path: D:\Programas\TwitchLeecher-master\Twitch Leecher\ffmpeg.exe
Temporary Download Folder: C:\Users\haris\AppData\Local\Temp\TL_5fa863ae-791f-4777-b72c-e4e1eb2880a8
ACCESS INFO
Token: %7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22chansub%22%3A%7B%22restricted_bitrates%22%3A%5B%5D%7D%2C%22device_id%22%3Anull%2C%22expires%22%3A1612083621%2C%22https_required%22%3Atrue%2C%22privileged%22%3Afalse%2C%22user_id%22%3Anull%2C%22version%22%3A2%2C%22vod_id%22%3A891965995%7D
Signature: ccbcc5dd068fbecb271d24ba867a332557092261
Sub-Only: No
Privileged: No
Creating temporary download directory 'C:\Users\haris\AppData\Local\Temp\TL_5fa863ae-791f-4777-b72c-e4e1eb2880a8'... done!
Retrieving m3u8 playlist urls for all VOD qualities... done!
https://d2nvs31859zcd8.cloudfront.net/333c43bdacdcfbf31731_a_couple_streams_41496491134_1611878332/chunked/index-dvr.m3u8
https://d2nvs31859zcd8.cloudfront.net/333c43bdacdcfbf31731_a_couple_streams_41496491134_1611878332/720p30/index-dvr.m3u8
https://d2nvs31859zcd8.cloudfront.net/333c43bdacdcfbf31731_a_couple_streams_41496491134_1611878332/480p30/index-dvr.m3u8
https://d2nvs31859zcd8.cloudfront.net/333c43bdacdcfbf31731_a_couple_streams_41496491134_1611878332/audio_only/index-dvr.m3u8
https://d2nvs31859zcd8.cloudfront.net/333c43bdacdcfbf31731_a_couple_streams_41496491134_1611878332/360p30/index-dvr.m3u8
https://d2nvs31859zcd8.cloudfront.net/333c43bdacdcfbf31731_a_couple_streams_41496491134_1611878332/160p30/index-dvr.m3u8
Playlist url for selected quality 1920x1080@30fps (Source) is https://d2nvs31859zcd8.cloudfront.net/333c43bdacdcfbf31731_a_couple_streams_41496491134_1611878332/chunked/index-dvr.m3u8
Retrieving playlist... done!
Parsing playlist... done!
Number of video chunks: 1213
Starting parallel video chunk download
Number of video chunks to download: 1213
Maximum connection count: 10
Parallel video chunk download is running...
Download of all video chunks complete!
Merging all VOD parts into 'D:\Videos\Captures\20210128_891965995_Music.ts'...
Starting temporary download folder cleanup!
Deleting directory 'C:\Users\haris\AppData\Local\Temp\TL_5fa863ae-791f-4777-b72c-e4e1eb2880a8'... done!
Download task ended with an error!
System.AggregateException: One or more errors occurred. ---> System.IO.FileNotFoundException: Could not find file 'D:\Videos\Captures\20210128_891965995_Music.ts'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at TwitchLeecher.Services.Services.ProcessingService.ConcatParts(Action1 log, Action1 setStatus, Action1 setProgress, VodPlaylist vodPlaylist, String concatFile)    at TwitchLeecher.Services.Services.TwitchService.<>c__DisplayClass51_0.<StartQueuedDownloadIfExists>b__2()    at System.Threading.Tasks.Task.Execute()    --- End of inner exception stack trace --- ---> (Inner Exception #0) System.IO.FileNotFoundException: Could not find file 'D:\Videos\Captures\20210128_891965995_Music.ts'. File name: 'D:\Videos\Captures\20210128_891965995_Music.ts'    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)    at TwitchLeecher.Services.Services.ProcessingService.ConcatParts(Action1 log, Action1 setStatus, Action1 setProgress, VodPlaylist vodPlaylist, String concatFile)
at TwitchLeecher.Services.Services.TwitchService.<>c__DisplayClass51_0.b__2()
at System.Threading.Tasks.Task.Execute()<---

What is the directory D:\Videos\Captures\?
D:\Videos\Captures\20210128_891965995_Music.mp4: No such file or directory
Could not find file 'D:\Videos\Captures\20210128_891965995_Music.ts'
Because TL seems to have a problem finding this directory. Is it an external drive or a NAS storage path?
Does the directory exist?
Does TL have write access to it?
I don't really see the problem to be honest. Usually TL creates non-existing directories.

What is the directory D:\Videos\Captures?
It'a folder that I created for storing the videos from TL
Because TL seems to have a problem finding this directory. Is it an external drive or a NAS storage path?
No It's my HD :(
Does TL have write access to it?
I think thats the issue, cause I just realized(trying to download some work files) that my PC is not allowing other programs to do anything with my computer(like download games from steam, or download something else using google chrome...)
I dont know what happened in this past days, but, I'll try to fix it and let u know if I find another problem.
Thanks for your help

Yeah, it was some bug with my antivirus, I reinstalled it and everything started to work again


Error: 'utf-8' codec can't encode character '\ud835' in position 22: surrogates not allowed

Hello, I'm having a problem adding card to Anki. Whenever I hit Ctrl + Shift + X to mine a sentence and update last card, it shows the error as below picture.

Is it something to do with my video and subtitle files? Both of them are downloaded from youtube with yt-dlp. Appreciate your reply, Thanks in advanced!

This appears to a bug related to how asbplayer is deriving the audio file name for the card. For this particular video I would suggest downloading the subtitle file, renaming it so that "Thunderstorm - 8 CC SUBS" uses plain letters (and not special unicode ones), and loading it up again. This way the derived audio file name won't be broken.

Fix is deployed for the website.
Next extension release will also have the fix.

Thank you. Just a heads up, it's because of the emoji in the file title. I removed the emoji and was able to mine again


[WSLowering] consumer release on each thread instead of master thread

Having each thread run the consumer release operation simplifies the logics by avoiding master thread id computation. This seems to help improve performance a bit.

2% speedup for triton_tutorial_flash_v2_tma_ws
0.3% speedup for matmul_layernorm_ws

Nice perf win!


Bindings Command-Argument

When I try to add bindings in order to auto-generate responses, I use the following command
php artisan api:generate --routePrefix="v1" --router="Dingo" --bindings=faq,1|tip,1
to use the Faq and Tip with ID 1
(as described here:
bindings - List of route bindings that should be replaced when trying to retrieve route results.
Syntax format: binding_one,id|binding_two,id

)
However, when executing the command, I get the following error:
The command 'tip' is either misspelled or could not be found.
Greetings

my fault.. sorry..
forgot the ""


Re-use common keysByCode data structure

Rather than create a new keysByCode mapping each time the keypressHelper factory is used, a common copy is lazily-instantiated the first time it's needed and is shared amongst all instances.

This PR seems to be obsolete. Moreover UI.Utils modules was split in individuals repositories. If still valid, please consider re-submitting on the dedicated repository.
See the README for details.


pyenv not installing any version successfully?

Your Windows build number: Microsoft Windows [Version 10.0.17763.737]

What you're doing and what's happening:  I'm attempting to use pyenv with WSL

What's wrong / what should be happening instead: I can install pyenv, however, when I use 'pyenv install {any version}' it won't ever succeed. The verbose log isn't much help, it passes some, it doesn't pass others, and logs about failing to install to target.

What's wrong / what should be happening instead: Target python version should be installed instead, and the plug in should enable multiple versions of python to live inside the pyenv directory.

All other prompts fell under N/A

My working solution is currently to just create a python virtual environment venv which seems to be giving no issues as of now.

Have you read over this? https://github.com/pyenv/pyenv/wiki/common-build-problems

Yes, the issue does not compare to any of those common-build-problems, however, it is no longer an issue for me, therefore I will simply close the issue, thanks!


Code for 13_diffuse_reflection is missing in the repo.

Hi Sean!
Thanks for running through the tutorial! This is because chapter 13's code is in the vk_mini_path_tracer directory, instead of the checkpoints directory, since it's sort of the main sample for this project in some sense.
The text in the box pointing to that chapter's code changes from the other chapters to match this (see here), but this is really easy to miss (since the previous 12 chapters' directories have almost had the same format), and at least one other person also missed this! I'll probably see if I can fix this in 2021 by adding a 13_diffuse_reflection directory with a file that says something like "see the vk_mini_path_tracer/vk_mini_path_tracer directory, at https://github.com/nvpro-samples/vk_mini_path_tracer/tree/main/vk_mini_path_tracer", like we currently do for e2_performance.

I see it. Thanks.