Update modeling_hymba.py
Browse files- modeling_hymba.py +56 -0
modeling_hymba.py
CHANGED
@@ -1718,6 +1718,62 @@ class HymbaBlock(nn.Module):
|
|
1718 |
print("\n\n\n\n")
|
1719 |
print(e)
|
1720 |
print(f"use_precomputed_states {use_precomputed_states}; {index} {self.D}, {time_proj_bias} ")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1721 |
print("\n\n\n\n")
|
1722 |
|
1723 |
scan_outputs = scan_outputs.transpose(1, 2)
|
|
|
1718 |
print("\n\n\n\n")
|
1719 |
print(e)
|
1720 |
print(f"use_precomputed_states {use_precomputed_states}; {index} {self.D}, {time_proj_bias} ")
|
1721 |
+
print(f"{self.D[index]} ")
|
1722 |
+
# cache_params.ssm_states[self.layer_idx],
|
1723 |
+
# hidden_states[..., 0],
|
1724 |
+
# discrete_time_step[..., 0],
|
1725 |
+
# A,
|
1726 |
+
# B[:, 0],
|
1727 |
+
# C[:, 0],
|
1728 |
+
# self.D[index],
|
1729 |
+
# gate[..., 0],
|
1730 |
+
# time_proj_bias,
|
1731 |
+
print("=== Variable Values ===")
|
1732 |
+
try:
|
1733 |
+
print(f"cache_params.ssm_states[{layer_idx}]: {cache_params.ssm_states[layer_idx]}")
|
1734 |
+
except Exception as e:
|
1735 |
+
print(f"Error accessing cache_params.ssm_states[{layer_idx}]: {e}")
|
1736 |
+
|
1737 |
+
try:
|
1738 |
+
print(f"hidden_states[..., 0]: {hidden_states[..., 0]}")
|
1739 |
+
except Exception as e:
|
1740 |
+
print(f"Error accessing hidden_states[..., 0]: {e}")
|
1741 |
+
|
1742 |
+
try:
|
1743 |
+
print(f"discrete_time_step[..., 0]: {discrete_time_step[..., 0]}")
|
1744 |
+
except Exception as e:
|
1745 |
+
print(f"Error accessing discrete_time_step[..., 0]: {e}")
|
1746 |
+
|
1747 |
+
try:
|
1748 |
+
print(f"A: {A}")
|
1749 |
+
except Exception as e:
|
1750 |
+
print(f"Error accessing A: {e}")
|
1751 |
+
|
1752 |
+
try:
|
1753 |
+
print(f"B[:, 0]: {B[:, 0]}")
|
1754 |
+
except Exception as e:
|
1755 |
+
print(f"Error accessing B[:, 0]: {e}")
|
1756 |
+
|
1757 |
+
try:
|
1758 |
+
print(f"C[:, 0]: {C[:, 0]}")
|
1759 |
+
except Exception as e:
|
1760 |
+
print(f"Error accessing C[:, 0]: {e}")
|
1761 |
+
|
1762 |
+
try:
|
1763 |
+
print(f"D[index]: {D[index]}")
|
1764 |
+
except Exception as e:
|
1765 |
+
print(f"Error accessing D[{index}]: {e}")
|
1766 |
+
|
1767 |
+
try:
|
1768 |
+
print(f"gate[..., 0]: {gate[..., 0]}")
|
1769 |
+
except Exception as e:
|
1770 |
+
print(f"Error accessing gate[..., 0]: {e}")
|
1771 |
+
|
1772 |
+
try:
|
1773 |
+
print(f"time_proj_bias: {time_proj_bias}")
|
1774 |
+
except Exception as e:
|
1775 |
+
print(f"Error accessing time_proj_bias: {e}")
|
1776 |
+
|
1777 |
print("\n\n\n\n")
|
1778 |
|
1779 |
scan_outputs = scan_outputs.transpose(1, 2)
|