Mitigating effects of data heterogeneity in decentralized learning and addressing challenges of adapting foundation models