Metatags are saved over and over in TensorBoardLogger when logging metrics
Is it okay that the metatags are saved every time metrics are logged in TensorBoardLogger? I find that it slows down training a bit.
I found a related discussion.
This is the part I'm talking about:

  
    
      pytorch-lightning/pytorch_lightning/loggers/tensorboard.py
    
    
        Lines 201 to 211
      in
      83ab3ea
    
  
  
    

        
          
           def save(self) -> None: 
        

        
          
               super().save() 
        

        
          
               dir_path = self.log_dir 
        

        
          
               if not gfile.isdir(dir_path): 
        

        
          
                   dir_path = self.save_dir 
        

        
          
            
        

        
          
               # prepare the file path 
        

        
          
               hparams_file = os.path.join(dir_path, self.NAME_HPARAMS_FILE) 
        

        
          
            
        

        
          
               # save the metatags file 
        

        
          
               save_hparams_to_yaml(hparams_file, self.hparams) 
        
    
  


which is called by:

  
    
      pytorch-lightning/pytorch_lightning/trainer/logging.py
    
    
        Lines 88 to 91
      in
      83ab3ea
    
  
  
    

        
          
           # log actual metrics 
        

        
          
           if self.is_global_zero and self.logger is not None: 
        

        
          
               self.logger.agg_and_log_metrics(scalar_metrics, step=step) 
        

        
          
               self.logger.save() 
        
    
  


which is in turn called by:

  
    
      pytorch-lightning/pytorch_lightning/trainer/training_loop.py
    
    
        Lines 749 to 757
      in
      83ab3ea
    
  
  
    

        
          
           def save_train_loop_metrics_to_loggers(self, batch_idx, batch_output): 
        

        
          
               # when metrics should be logged 
        

        
          
               should_log_metrics = (batch_idx + 1) % self.row_log_interval == 0 or self.should_stop 
        

        
          
               if should_log_metrics or self.fast_dev_run: 
        

        
          
                   # logs user requested information to logger 
        

        
          
                   metrics = batch_output.batch_log_metrics 
        

        
          
                   grad_norm_dic = batch_output.grad_norm_dic 
        

        
          
                   if len(metrics) > 0 or len(grad_norm_dic) > 0: 
        

        
          
                       self.log_metrics(metrics, grad_norm_dic)